×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    9

    DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Hello there everyone

    I hope someone could help me with Qt

    I have some files that are in resourc directory under my project.


    I have added the following in my project.pro
    Code:
    dir1.source = resourc\*
    DEPLOYMENTFOLDERS = dir1
    Working nice on Symbian, Simulator..

    In maemo, I can see the file in terminal,(it's in opt/appname/bin and all resource are in opt/appname ) but It's not opening in my app, the app can't see the file, also I have managed to make everything in one folder, but still nothing happen, Maybe we have to change the working directory of the application or something?

    In meego I get this error

    Code:
    :-1: error: [copydeploymentfolders] Error 1
    File Not Found
    I hope someone can help me,

    Also I have deployment.pri but not touched.

    Before adding some files the app was working nice on N950, but now this error came in.

    Thank you.
    Last edited by q8phantom; 2011-08-21 at 02:01.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    9

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Hi there,

    My guess was right, it’s the working directory that was wrong, I solved the problem related to maemo N900, but still N950 with the build issue. I’ll search in this too, anyways here is the N900 maemo solution, add this code in main, first

    #include <QDir>
    and then just under this line


    QApplication app(argc, argv);
    I added these so it looks like this

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QDir dir(QCoreApplication::applicationDirPath());
    #if defined(Q_WS_MAEMO_5)
    if (dir.dirName().toLower() == "bin")
    {
    dir.cdUp();
    }

    #endif
    QDir::setCurrent(dir.absolutePath());
    // rest of main
    return app.exec();

    }

  3. #3
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    This works for me on N950:

    dir1.files = dir1/*
    dir1.path = /opt/$${TARGET}
    INSTALLS += dir1

  4. #4
    Registered User
    Join Date
    Jul 2009
    Posts
    8

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Quote Originally Posted by magicdave View Post
    This works for me on N950:

    dir1.files = dir1/*
    dir1.path = /opt/$${TARGET}
    INSTALLS += dir1
    This works great. But what if I have to write to a file I deploy this way within my Application?

    The files have on the N950 only write permission for root, they are read only for the user.

    Are there options to modify this flags within the *.pro file?

  5. #5
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Not 100% but based on the fact that it's unix you should probably create files that you want to write to in the user home directory, AFTER not during installation, on first run. Since the user can easily get root I don't think there's an equivalent to the private directory in Symbian?

  6. #6
    Registered User
    Join Date
    Jul 2009
    Posts
    8

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Yes, I want to store the file in /home/user/.config/APPLICATIONNAME/ - this is the place to store settings files for applications.

    If I place this file there during the installation it has the permission .wr..r..r - but I need .wr.wr.wr - so only the root has write permission.
    If I don't place the file in this directory the subdirectory for my config files is not created. And my App has no permission during runtime to create there directories.

    The directory is created if I store something using QSettings - but I don't have to store something in a ini file and hence I'm searching for a more official solution. The right way to place a file with custom access settings somewhere on the system during the installation. I don't like dirty workarounds... and I'm still not sure if this QSettings workaround would create a directory with the right access settings or only the file.

  7. #7
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Hi,
    Good packages must not install anything in /home/user. QSettings creates the config file in the home folder by itself.
    If you have to fill it, then your application should do that at first run.
    Why do you need to install it using the package?
    There are no documentation about this because you are doing something wrong.

  8. #8
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Have a look here:
    http://www.developer.nokia.com/Commu...k/Data_Storage

    This lists out how to get paths that you should be able to write application information to, with or without QSettings.

  9. #9
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    That page is correct.
    The question is: why do you need to install a config file which could be created and initialized by your application?

  10. #10
    Registered User
    Join Date
    Jul 2009
    Posts
    8

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Sorry for my late answer. I had no Internet Access during the day.

    Quote Originally Posted by gnuton View Post
    Hi,
    Good packages must not install anything in /home/user. QSettings creates the config file in the home folder by itself.
    If you have to fill it, then your application should do that at first run.
    Why do you need to install it using the package?
    There are no documentation about this because you are doing something wrong.
    Yes, I see. I changed now how my application works.

    I create the file now myself within my application and deliver the default content using a resources file.
    Is this file also deleted when I remove my application later using apt-get purge or is this only covered by QSettings and the myself created file will persist?

    Quote Originally Posted by gnuton View Post
    The question is: why do you need to install a config file which could be created and initialized by your application?
    I wanted to deliver a sqlite database file with some presets inside within the debian package. Not a config file. I haven't known that I get access to the file if I create the /home/user/.config/APPLICATIONNAME/ path myself within my application. I thought I have in any case to change the access settings using chmod or something else during the installation. I had such a problem with a python and gtk application at maemo5.
    But it works now great this way at Harmattan! Thanks!

    The drawback of this solution is that my binary file is now 30% larger than without the needed presets for my sqlite database file inside. The debian package has nearly the same size, so there is no much difference if I copy it to the needed path during the installation or if I create it at the first startup. The download size is the same. But a bigger binary causes a longer startup time for my application. And I wanted to avoid this.

    So I have now a good working solution but it has still potential to improve it.

  11. #11
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Quote Originally Posted by helex View Post
    Sorry for my late answer. I had no Internet Access during the day.
    Is this file also deleted when I remove my application later using apt-get purge or is this only covered by QSettings and the myself created file will persist?
    If the application is removed by the harmattan setting panel the config files are not removed. I think you need a postrm file to remove config files.

    I wanted to deliver a sqlite database file with some presets inside within the debian package. Not a config file. I haven't known that I get access to the file if I create the /home/user/.config/APPLICATIONNAME/ path myself within my application. I thought I have in any case to change the access settings using chmod or something else during the installation. I had such a problem with a python and gtk application at maemo5.
    But it works now great this way at Harmattan! Thanks!
    Sometimes Harmattan security framework is lovable. ;D


    The drawback of this solution is that my binary file is now 30% larger than without the needed presets for my sqlite database file inside. The debian package has nearly the same size, so there is no much difference if I copy it to the needed path during the installation or if I create it at the first startup. The download size is the same. But a bigger binary causes a longer startup time for my application. And I wanted to avoid this.

    So I have now a good working solution but it has still potential to improve it.
    What about filling the SQLite DB using data coming from a file in /opt (file which is installed by your package)

  12. #12
    Registered User
    Join Date
    Jul 2009
    Posts
    8

    Re: DEPLOYMENTFOLDERS in .pro working in simulator,symbian but not maemo,meego

    Quote Originally Posted by gnuton View Post
    What about filling the SQLite DB using data coming from a file in /opt (file which is installed by your package)
    Hmmm... yeeeees... perhaaaps. I will see if Qt provides a solution to open a SqLite Database readonly. In this case I could simply duplicate the content of the tables and write it to the fresh created file. Everything else will create more and more work and confusion. My current solution works and I already uploaded it to the ovi store. But I will see if I try your advice for a update.

    It's like refactoring sourcecode. The user can't see a big difference in the first place but it is still a lot of work. I will see if I have enought time to do this work in hope I feel afterwards better.

    But your Idea is good. I will get a smaller binary and after the first startup with the preparings a good performance. And the package size is also minimal.
    But it will still feel just not right because I put in this case the data twice on the user device. Hmm...

Similar Threads

  1. [moved] Qml is not working in MeeGo sdk 1.1
    By kotesh.06521 in forum [Archived] Qt SDKs and Tools
    Replies: 6
    Last Post: 2011-03-16, 12:48
  2. Replies: 6
    Last Post: 2010-12-17, 14:44
  3. QtMobility headers working on simulator but not on symbian.
    By Harmiih in forum [Archived] Qt Mobility Project
    Replies: 3
    Last Post: 2010-08-10, 16:55
  4. Replies: 2
    Last Post: 2006-03-11, 09:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×