summaryrefslogtreecommitdiffstats
path: root/examples/xml
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-11-25 15:48:22 +0200
committerJanne Anttila <janne.anttila@digia.com>2009-11-25 15:50:55 +0200
commit2a3a270e5d2a26b9ef7405abfa1892beaece9b04 (patch)
tree32f10bd81979a918a10d477ffcd174b693e8e212 /examples/xml
parentde593891c0e65c74d92958a7f6262ee01c055902 (diff)
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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp
index 49cb468bcf..ff3cf11917 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