/home/web_user @ start of app is empty.
-
Hi, hopefully someone here can help...
I am trying to port an app to webassembly and I am running into a very serious problem. The (desktop) app makes the assumption that the files (and settings) in /home/web_user are up-to-date when the app starts. However, I find that this is not the case, only a few seconds after main() has started will the sync of the IDBFS finish and only then will the settings be valid. However, the settings store things that are relevant to the app itself, such as the configurations of the toolbars, and other things. In addition the app also scans for other user files which may be present, so not having them at startup is a very serious limitation.
Is there any way that I can delay the startup of the application until the sync has finished? The sync is started in the constructor of QCoreApplication, so I figure, all I have to do is wait until the settings file is actually there by testing for its existing using QFileInfo::exists(). But that doesn't seem to work, i.e. the file never appears. I have also thought, maybe if we simply nanosleep it would work, but again to no avail.
Any advice would be greatly appreciated.
Andres
-
The javascript FS functions we use for syncing the settings are asynchronous, so the c'tor will complete before the settings file has synced into the wasm sandbox filesystem.
That said, there is a change that I have found helps somewhat. If you build Qt yourself, you could try this:
https://codereview.qt-project.org/c/qt/qtbase/+/264618