diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2018-10-09 10:14:43 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2019-11-14 12:10:29 +1000 |
commit | a3f62d7ead78fde31bc26dd35d4bf6789a7b9e2f (patch) | |
tree | 7711fe689b51457e163e07848a08795f67301fb9 /src/corelib/io/qsettings_p.h | |
parent | f2cf5f5417d4df68eb0677e375cb81e39286c05f (diff) |
wasm: add platform qsettings
Since the backend is async, the settings will not be ready to read/write
instantly as on other platforms, but only be ready after the
filesystem has been synced to the sandbox. This takes at least 250 to
500 ms. The QSettings status() or isWritable() can be used to discern when the
settings are ready for use.
This also fixes a crash in threaded wasm
Task-number: QTBUG-70002
Fixes: QTBUG-63923
Fixes: QTBUG-79650
Change-Id: If24c6ada1b91b2a565ed6733da74972c3027f622
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/corelib/io/qsettings_p.h')
-rw-r--r-- | src/corelib/io/qsettings_p.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index d18c96a06c..c30f099a72 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -57,6 +57,10 @@ #include "QtCore/qiodevice.h" #include "QtCore/qstack.h" #include "QtCore/qstringlist.h" + +#include <QtCore/qvariant.h> +#include "qsettings.h" + #ifndef QT_NO_QOBJECT #include "private/qobject_p.h" #endif @@ -253,6 +257,10 @@ protected: mutable QSettings::Status status; }; +#ifdef Q_OS_WASM +class QWasmSettingsPrivate; +#endif + class QConfFileSettingsPrivate : public QSettingsPrivate { public: @@ -281,7 +289,7 @@ public: private: void initFormat(); - void initAccess(); + virtual void initAccess(); void syncConfFile(QConfFile *confFile); bool writeIniFile(QIODevice &device, const ParsedSettingsMap &map); #ifdef Q_OS_MAC @@ -297,6 +305,9 @@ private: QString extension; Qt::CaseSensitivity caseSensitivity; int nextPosition; +#ifdef Q_OS_WASM + friend class QWasmSettingsPrivate; +#endif }; QT_END_NAMESPACE |