Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
4.5.3
-
None
-
497fd44414dea6314731b96869e2d49bb8b439b5
Description
Hi there,
In the doc of QSettings, there is:
>QSettings can safely be used from different processes (which can be different instances of your application
> running at the same time or different applications altogether) to read and write to the same system locations.
> It uses advisory file locking and a smart merging algorithm to ensure data integrity.
> Changes performed by another process aren't visible in the current process until sync() is called.
Does that mean that sync() must be called by the "current process", by the "other process", or both ?
In other terms, does sync() writes to disc, or re-reads from disc, or both ?
The words "advisory file locking" lets me think that QSettings monitors modified files, hence that any process accessing to a QSetting file is told when the file has been modified b y another process. If this is right, sync() only ensure writing to disc.
Conversely, in QSetting::sync() doc:
> Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in the meantime by another application.
makes me think that sync() must be called also to reload modified settings.
I do think that the latest is correct, finally, that is: sync() writes to disc AND re-loads from disc, so should be called in both processes.
But the issue may be clarified in the doc.