diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2018-10-09 10:14:43 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2020-02-18 12:40:24 +1000 |
commit | d7b6c4288f2de8b0123c888e83a3fbcd84ed906f (patch) | |
tree | 1cdcf44c2c707d92ce336850c9b6b819184f6f13 /src/corelib/kernel | |
parent | 1538395e3f0ace5c4ace01f41be00be149624c6a (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
Change-Id: I080bdb940aa8e9a126d7358b524f32477db151b6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index e25049f821..70f0a5ad4c 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -121,7 +121,6 @@ #endif #ifdef Q_OS_WASM -#include <emscripten.h> #include <emscripten/val.h> #endif @@ -497,13 +496,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint QCoreApplicationPrivate::~QCoreApplicationPrivate() { -#ifdef Q_OS_WASM - EM_ASM( - // unmount persistent directory as IDBFS - // see also QTBUG-70002 - FS.unmount('/home/web_user'); - ); -#endif #ifndef QT_NO_QOBJECT cleanupThreadData(); #endif @@ -795,17 +787,8 @@ void QCoreApplicationPrivate::init() Q_ASSERT_X(!QCoreApplication::self, "QCoreApplication", "there should be only one application object"); QCoreApplication::self = q; -#ifdef Q_OS_WASM - EM_ASM( - // mount and sync persistent filesystem to sandbox - FS.mount(IDBFS, {}, '/home/web_user'); - FS.syncfs(true, function(err) { - if (err) - Module.print(err); - }); - ); - #if QT_CONFIG(thread) +#ifdef Q_OS_WASM QThreadPrivate::idealThreadCount = emscripten::val::global("navigator")["hardwareConcurrency"].as<int>(); #endif #endif |