diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-11-25 13:48:22 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-11-25 13:50:55 (GMT) |
commit | 2a3a270e5d2a26b9ef7405abfa1892beaece9b04 (patch) | |
tree | 32f10bd81979a918a10d477ffcd174b693e8e212 /examples/xml | |
parent | de593891c0e65c74d92958a7f6262ee01c055902 (diff) | |
download | Qt-2a3a270e5d2a26b9ef7405abfa1892beaece9b04.zip Qt-2a3a270e5d2a26b9ef7405abfa1892beaece9b04.tar.gz Qt-2a3a270e5d2a26b9ef7405abfa1892beaece9b04.tar.bz2 |
Fix for "saxbookmarks - file dialog starts in wrong directory (winscw)"
QCoreApplication::applicationFilePath() in emulator returns path to
Z drive. Use QDesktopServices instead which always returns the writable
drive.
Task-number: QTBUG-6117
Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'examples/xml')
-rw-r--r-- | examples/xml/saxbookmarks/mainwindow.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp index 49cb468..ff3cf11 100644 --- a/examples/xml/saxbookmarks/mainwindow.cpp +++ b/examples/xml/saxbookmarks/mainwindow.cpp @@ -67,8 +67,11 @@ MainWindow::MainWindow() void MainWindow::open() { #if defined(Q_OS_SYMBIAN) - // Always look for bookmarks on the same drive where the application is installed to. - QString bookmarksFolder = QCoreApplication::applicationFilePath().left(1); + // Look for bookmarks on the same drive where the application is installed to, + // if drive is not read only. QDesktopServices::DataLocation does this check, + // and returns writable drive. + QString bookmarksFolder = + QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1); bookmarksFolder.append(":/Data/qt/saxbookmarks"); QDir::setCurrent(bookmarksFolder); #endif |