×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    43

    Creating application files

    I'm developing QT application on S60. The application deals with its own database. Initial DB is coming as QT resourse. During run-time the database should be saved locally and populated with actual data. DB could grow with graphics data. The best place for DB is the mass memory but if it doesn't exist on the device then phone memory. I would like this file is created automatically without bothering user.

    - What will be the good way to recognize that mass memory is available and create private application path there and if it is not available create the phone memory file? Does QFile has methods to help me?

    - How unintaller will delete application created DB file? I don't want to leave the left over and shall delete DB during uninstallation.

    Thank you for hints.
    Last edited by pavel_turbin; 2010-07-02 at 04:35. Reason: splling

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating application files

    I think that unless you want to install it on the application's drive or on a specific lettered drive then you have to write some logic to move the DB where you want it and delete it during uninstall. I've never gotten into the install/uninstall program stuff, so I can't give you much more than that.

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: Creating application files

    Hi,

    You can use QDir::exists() to check if removable storage drive is available. Typically the memory card (or flash drive) is E:\ on Symbian/S60 devices, but there may be some exceptions. If you want to play it safe then consider using QSystemStorageInfo from Qt Mobility.

    Deleting application-created files on uninstall: Easy if the exact path of the file is already known at install-time. Add a 'filenull' deployment as follows:

    Code:
        uid3 = $$lower($${TARGET.UID3})    
        dbfile.pkg_postrules = "\"\" - \"e:/private/$$replace(uid3, 0x, "")/$$DBFILENAME\", FN"
        DEPLOYMENT += dbfile
    - This will generate something like this into the pkg file:

    Code:
    "" - "e:/private/e12c410e/mydata.db", FN
    This will mark the file to be removed during uninstall, if it exists. Repeat for any other drive(s) that the db file can be potentially created in, c:/ at least.

    Edit: Actually the above is not even needed, if you create your db file in the application's private directory since it's removed at uninstall regardless if it's empty or not.. Anyway, the key is the FN (FILENULL) option, use it if you have the database in some other (unprotected) folder.
    Last edited by treinio; 2010-07-02 at 15:09.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    43

    Re: Creating application files

    Quote Originally Posted by treinio View Post
    Hi,

    You can use QDir::exists() to check if removable storage drive is available. Typically the memory card (or flash drive) is E:\ on Symbian/S60 devices, but there may be some exceptions. If you want to play it safe then consider using QSystemStorageInfo from Qt Mobility.
    Thanks for very useful hints.

    I guess using QSystemStorageInfo requires from a user installing qtmobility.sis. I found that I could use native Symbian service PathInfo.

Similar Threads

  1. Creating SIS Files
    By patlucas in forum Symbian
    Replies: 23
    Last Post: 2010-01-18, 10:50
  2. problems about creating files
    By yeliya in forum Mobile Java General
    Replies: 5
    Last Post: 2009-04-18, 11:02
  3. creating sisx files
    By bjamate in forum Symbian
    Replies: 5
    Last Post: 2008-01-28, 22:43
  4. Creating jar files from class files
    By bhandari in forum Mobile Java General
    Replies: 4
    Last Post: 2003-12-25, 13:53

Posting Permissions

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