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/dombookmarks/dombookmarks.pro | 15 ++++++++++++--- examples/xml/dombookmarks/main.cpp | 5 +++++ examples/xml/dombookmarks/mainwindow.cpp | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) (limited to 'examples/xml/dombookmarks') diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro index aa815457f5..3d38ca3f47 100644 --- a/examples/xml/dombookmarks/dombookmarks.pro +++ b/examples/xml/dombookmarks/dombookmarks.pro @@ -13,8 +13,17 @@ INSTALLS += target sources symbian: CONFIG += qt_example +symbian: { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + addFiles.sources = frank.xbel jennifer.xbel + addFiles.path = files + DEPLOYMENT += addFiles +} + wince*: { - addFiles.files = frank.xbel jennifer.xbel - addFiles.path = "\\My Documents" - DEPLOYMENT += addFiles + addFiles.files = frank.xbel jennifer.xbel + addFiles.path = "\\My Documents" + DEPLOYMENT += addFiles } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/xml/dombookmarks/main.cpp b/examples/xml/dombookmarks/main.cpp index 71ce6aec0b..6a3bb8c1a9 100644 --- a/examples/xml/dombookmarks/main.cpp +++ b/examples/xml/dombookmarks/main.cpp @@ -46,7 +46,12 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow mainWin; +#if defined(Q_OS_SYMBIAN) + mainWin.showMaximized(); +#else mainWin.show(); +#endif + mainWin.open(); return app.exec(); } diff --git a/examples/xml/dombookmarks/mainwindow.cpp b/examples/xml/dombookmarks/mainwindow.cpp index b3bfe64e17..0a3a3f9c3b 100644 --- a/examples/xml/dombookmarks/mainwindow.cpp +++ b/examples/xml/dombookmarks/mainwindow.cpp @@ -59,6 +59,15 @@ MainWindow::MainWindow() 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(), @@ -81,6 +90,15 @@ void MainWindow::open() 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