From 0748751c9f097d9d866605306bbdd4b96e2a5c4e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 27 Apr 2011 19:16:41 +0200 Subject: Squashed commit of the changes from the mobile-examples repository (4.7-generated-declarative branch). --- examples/xml/streambookmarks/mainwindow.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'examples/xml/streambookmarks/mainwindow.cpp') diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp index e9236e93e6..ac839fe9a0 100644 --- a/examples/xml/streambookmarks/mainwindow.cpp +++ b/examples/xml/streambookmarks/mainwindow.cpp @@ -68,6 +68,15 @@ MainWindow::MainWindow() //! [1] void MainWindow::open() { +#if defined(Q_OS_SYMBIAN) + // 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 QString fileName = QFileDialog::getOpenFileName(this, tr("Open Bookmark File"), QDir::currentPath(), @@ -103,6 +112,15 @@ void MainWindow::open() //! [2] void MainWindow::saveAs() { +#if defined(Q_OS_SYMBIAN) + // 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 QString fileName = QFileDialog::getSaveFileName(this, tr("Save Bookmark File"), QDir::currentPath(), -- cgit v1.2.3