Version of App problem, help.

I developed an application with basic reading and writing (access SQLData) data.

on Debug or Run it works perfectly, but when I'm creating a release and run the bed application only from the database.

Something like that...

bool DbHelper::copyDbToDataFolder(const QString databaseName)
{
    // Since we need read and write access to the data base it has
    // to be moved to a folder where we have access to it. First
    // we check if the file already exists (previously copied)
    QString dataFolder = QDir::homePath();
    QString newFileName = dataFolder + "/" + databaseName;
    QFile newFile( newFileName );

    if (!newFile.exists()) {
        // If the file is not already in the data folder we copy it from the
        // assets folder (read only) to the data folder (read and write).
        // Note that on a debug build you will be able to write to a data base
        // in the assets folder but that is not possible on a signed application.
        QString appFolder(QDir::homePath());
        appFolder.chop(4);
        QString originalFileName = appFolder + "app/native/assets/sql/" + databaseName;
        QFile originalFile( originalFileName );

        if (originalFile.exists()) {
            return originalFile.copy(newFileName);
        } else {
            qWarning() << "Failed to copy file, database file does not exist.";
            return false;
        }

    }

    return true;
}

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • I can't sign Mozilla account

    Given that I have updated to the latest Mozilla Firefox 19, I had a few problems.I have more of Firefox in the upper left box.I open Mozilla to go online, but when I question it does not recognize my password when I try to retrieve e-mail that does n

  • NB550D - BSOD when connected to Wi - Fi

    Hi guys I bought my NB550d year last to take the os on a school trip. Love everything about her, except for one thing. I'm going crazy trying to solve this problem. Any help would be great. I constantly get a BSOD when I'm on the net. There is nothin

  • Network advertising readers and apple script editor or

    I have a new laptop Mac. I have it on a Windows domain and I get my drive mapping in the sidebar when I connect with my AD account. When I change my account to a mobile account, I lose the map in the sidebar. I get it if I connect to the server, but

  • New installation of XP Pro, cannot update windows

    Brought home an old post office work for minimal use for my wife not so necessary or expected.  Wanted above all be able to access my office off site using GOTOMYPC for work.   XP Pro SP1, it's what he has to load XP again.  Load without problems, bu

  • during the installation of updates, get error msg 80070570 please help

    need help get this msg of error.