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/rsslisting/main.cpp | 4 ++++ examples/xml/rsslisting/rsslisting.cpp | 20 ++++++++++++++++++++ examples/xml/rsslisting/rsslisting.h | 15 +++++++++++++++ examples/xml/rsslisting/rsslisting.pro | 12 +++++++++++- 4 files changed, 50 insertions(+), 1 deletion(-) (limited to 'examples/xml/rsslisting') diff --git a/examples/xml/rsslisting/main.cpp b/examples/xml/rsslisting/main.cpp index 011569f2b6..78abb92e8d 100644 --- a/examples/xml/rsslisting/main.cpp +++ b/examples/xml/rsslisting/main.cpp @@ -58,6 +58,10 @@ int main(int argc, char **argv) { QApplication app(argc, argv); RSSListing *rsslisting = new RSSListing; +#if defined(Q_OS_SYMBIAN) + rsslisting->showMaximized(); +#else rsslisting->show(); +#endif return app.exec(); } diff --git a/examples/xml/rsslisting/rsslisting.cpp b/examples/xml/rsslisting/rsslisting.cpp index 5840f08d09..ffc6d1a6c7 100644 --- a/examples/xml/rsslisting/rsslisting.cpp +++ b/examples/xml/rsslisting/rsslisting.cpp @@ -74,6 +74,24 @@ its operation, and also allows very large data sources to be read. RSSListing::RSSListing(QWidget *parent) : QWidget(parent), currentReply(0) { +#ifdef Q_OS_SYMBIAN + // Set Internet Access Point + QNetworkConfigurationManager manager; + const bool canStartIAP = manager.capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces; + + // Is there default access point, use it + QNetworkConfiguration cfg = manager.defaultConfiguration(); + if (!cfg.isValid() || !canStartIAP) { + // Available Access Points not found + QMessageBox::warning(this, "Error", "No access point"); + return; + } + + m_session = new QNetworkSession(cfg); + m_session->open(); + m_session->waitForOpened(); +#endif + lineEdit = new QLineEdit(this); lineEdit->setText("http://labs.qt.nokia.com/blogs/feed"); @@ -104,7 +122,9 @@ RSSListing::RSSListing(QWidget *parent) layout->addWidget(treeWidget); setWindowTitle(tr("RSS listing example")); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) resize(640,480); +#endif } /* diff --git a/examples/xml/rsslisting/rsslisting.h b/examples/xml/rsslisting/rsslisting.h index 98254f839b..49c694092c 100644 --- a/examples/xml/rsslisting/rsslisting.h +++ b/examples/xml/rsslisting/rsslisting.h @@ -48,6 +48,16 @@ #include #include +#ifdef Q_OS_SYMBIAN +// Bearer +#include +#include +#include + +// QtMobility namespace +QTM_USE_NAMESPACE +#endif + QT_BEGIN_NAMESPACE class QLineEdit; class QTreeWidget; @@ -84,6 +94,11 @@ private: QLineEdit *lineEdit; QTreeWidget *treeWidget; QPushButton *fetchButton; + +#ifdef Q_OS_SYMBIAN + // for bearer management + QPointer m_session; +#endif }; #endif diff --git a/examples/xml/rsslisting/rsslisting.pro b/examples/xml/rsslisting/rsslisting.pro index c883b77ada..413fdf651e 100644 --- a/examples/xml/rsslisting/rsslisting.pro +++ b/examples/xml/rsslisting/rsslisting.pro @@ -8,5 +8,15 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS rsslisting.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/xml/rsslisting INSTALLS += target sources -symbian: CONFIG += qt_example +symbian { + CONFIG += qt_example + # For QtMobility + CONFIG += mobility + MOBILITY = bearer + + # For QtMobility + TARGET.CAPABILITY = NetworkServices +} + +maemo5: CONFIG += qt_example -- cgit v1.2.3 From 0cbcc61ef35b9bce1d65d048853c79004b755b87 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 11 May 2011 17:35:46 +0200 Subject: Squashed commit of changes from the 4.8-temp branch. --- examples/xml/rsslisting/rsslisting.desktop | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 examples/xml/rsslisting/rsslisting.desktop (limited to 'examples/xml/rsslisting') diff --git a/examples/xml/rsslisting/rsslisting.desktop b/examples/xml/rsslisting/rsslisting.desktop new file mode 100644 index 0000000000..e45fe4a3e8 --- /dev/null +++ b/examples/xml/rsslisting/rsslisting.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=RSS-Listing +Exec=/opt/usr/bin/rsslisting +Icon=rsslisting +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable -- cgit v1.2.3