From 2a3a270e5d2a26b9ef7405abfa1892beaece9b04 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 25 Nov 2009 15:48:22 +0200 Subject: 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 --- examples/xml/saxbookmarks/mainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples/xml') 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 -- cgit v1.2.3