The docs state that:
> Note that INI files lose the distinction
between numeric data and the strings used
to encode them, so values written as numbers
shall be read back as QString. The numeric
value can be recovered using QString::toInt(),
QString::toDouble() and related functions.
Currently, double-precision numbers can not
be reconstructed properly due to QString's
way of handling dp numbers.
Since they are read back as QString, we
should save these numbers according to the
precision that QString is comfortable with,
so that they are parsed properly when the
application starts.
/home/videolan/vlc/extras/package/win32/../../../modules/gui/qt/maininterface/mainctx.cpp:187:42: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
QMetaObject::invokeMethod(this, [this](){
^~~~
1. The mechanism implemented to keep these two in-sync is broken
2. Interface changes some CSD controls based on window visibility, this
causes conflicts (ref #26668)
Note that in some cases they have been changed to forward declarations, and
in some they have been moved, for instance inclusion of `<QUrl>` was moved
from `qt.hpp` to where it was needed.
this function allows to run lambdas on the ML thread, this should be used to
perform operation that requires to call vlc_ml_xxx functions as vlc_ml_xxx
should *not* be called from the UI thread
obj: this is the instance of the calling QObject, we ensure that this object is
still live when calling the ui callback, if this object gets destroyed the task
is canceled
mlCb: this callback is executed in a background thread (thread pool), it takes
as arguments the instance of the medialibrary, and a context, the context can be
modified to pass data to the UI callback
uiCB: this callback is executed on the Qt thread, it takes as first argument the
id of the tasks, and as second argument the context that was created for the ML
callback
queue: this allow the task to be ran on a specific thread, when this parameter
isn't provided, the task can be scheduled on any thread.
Ctx is the type of context, this context is created by the runner and passed
sequentially to the ML callback then to UI callback, the ML callback may modify
its properties as a way to pass data to the UI callback
⚠️ the ml callback **SHOULD NOT** capture the obj object or point to its
properties by reference, as the obj object may potentially be destroyed when the
function is called
the ui callback **MAY** capture the object obj as we will ensure that the object
still exists before calling the callback
the uiCb **MAY NOT** be called if the object obj is released earlier
anything stored int the context Ctx **MUST** auto release when the context is
destroyed
sample usage:
```
//structure used to pass data from the ML thread to the UI thread
struct Ctx {
bool success;
};
m_mediaLib->runOnMLThread<Ctx>(
//reference to the object making the call, this is used to ensure that
//the caller still exists before calling the UI callback
this,
//ML thread, data needed from the caller are passed in the capture of the lambda
//capturing this or any of its member is not allowed here
//the callback have in parametters the ml instance and a context that will be shared with
//the UI callback
[url, indexed](vlc_medialibrary_t* ml, Ctx& ctx)
{
int res;
if ( indexed )
res = vlc_ml_add_folder( ml, qtu( url ) );
else
res = vlc_ml_remove_folder( ml, qtu( url ) );
ctx.success = (res == VLC_SUCCESS);
},
//UI callback, capturing this is allowed, (runOnMLThread will ensure that `this`
//still exists at this point
//the callback has as parametters the request id and the shared context
[this, indexed](quint64, Ctx& ctx){
if (ctx.success)
{
m_indexed = indexed;
emit isIndexedChanged();
}
},
//allow to specify if the task should be run on a specific thread, null (default) will run on any thread
"ML_FOLDER_ADD_QUEUE");
```
qt/open_panels: use 'save-recentplay'
qt/preferences: use 'save-recentplay'
qt/MainInterface: use 'save-recentplay'
qt/recent_menu: use 'save-recentplay'
fixes undefined sanitizers warnings -
../../modules/gui/qt/maininterface/main_interface.cpp:283:19: runtime
error: load of value 190, which is not a valid value for type 'bool'
.... etc