Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. /home/web_user @ start of app is empty.
QtWS25 Last Chance

/home/web_user @ start of app is empty.

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 2 Posters 541 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andreskruse
    wrote on 5 Nov 2019, 09:53 last edited by andreskruse 11 May 2019, 22:26
    #1

    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

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lorn.potter
      wrote on 6 Nov 2019, 23:44 last edited by
      #2

      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

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      1 Reply Last reply
      2

      1/2

      5 Nov 2019, 09:53

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved