Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved] N950 writable folders

[Solved] N950 writable folders

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 2.4k Views 1 Watching
  • 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.
  • AlicemirrorA Offline
    AlicemirrorA Offline
    Alicemirror
    wrote on last edited by
    #1

    Hi, I have to manage some data to be written on files in the N950 environment. When the package is installed it is put in the folder
    @
    /opt/Package_Name/bin/
    @
    I have configuration files that are included in the application that I put in a /data/ folder that I find on the device in
    @
    /opt/Package_Name/data/
    @
    The files that I will write at runtime - as logic suggest - maybe put in the
    @
    /home/user/myfolder/
    @
    Regardless that I know what is the application folder, I build the data folder path using a call to QApplication::applicationDirPath() as shown in the snippet below
    @
    fullFileName.append(QApplication::applicationDirPath());
    fullFileName.append("/../");
    fullFileName.append("myfolder/");
    fullFileName.append(m_fname);
    @
    Is there a similar way to acquire the path of the current user folder where I can create my folders, save files etc. or I should use the string "/home/user/" as a constant ?

    Many thanks for any suggestion.

    Enrico Miglino (aka Alicemirror)
    Balearic Dynamics
    Islas Baleares, Ibiza (Spain)
    www.balearicdynamics.com

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      I think that QDir::homePath() should help you

      1 Reply Last reply
      0
      • AlicemirrorA Offline
        AlicemirrorA Offline
        Alicemirror
        wrote on last edited by
        #3

        Thank you Denis,

        now I will check what other parameters can be obatined from QDir. :)

        Enrico Miglino (aka Alicemirror)
        Balearic Dynamics
        Islas Baleares, Ibiza (Spain)
        www.balearicdynamics.com

        1 Reply Last reply
        0
        • AlicemirrorA Offline
          AlicemirrorA Offline
          Alicemirror
          wrote on last edited by
          #4

          @Denis: thanks, this is the right way. I can manage almost all the essential system folders and create new ones in the writable folders (user permissions).

          Enrico Miglino (aka Alicemirror)
          Balearic Dynamics
          Islas Baleares, Ibiza (Spain)
          www.balearicdynamics.com

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mismail
            wrote on last edited by
            #5

            I have a similar problem.
            my application contains a database that i should write in at runtime.
            but I always get the following message in the console.

            bq. "attempt to write a readonly database Unable to fetch row"

            I think it a problem of permissions.
            My application deployed to
            @/opt/myapplication/bin@
            and the database deployed to
            @/home/user/myapplication/data/faces.db@

            I deployed it using the following lines in the pro file
            @unix:!symbian{
            db.files = faces.db
            db.path = /home/user/myApplication/data
            INSTALLS += db
            }@

            So how could I make it writable for the user?

            Thanks in advance

            1 Reply Last reply
            0

            • Login

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