summaryrefslogtreecommitdiffstats
path: root/demos/embedded/anomaly
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-07-07 06:28:45 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-07-19 00:32:33 (GMT)
commit75db37022a9fd479e2a446b57e774eaf8e3e73ea (patch)
treec00dffdb4fe9f38aba2385ff686c2d16b2cae2e3 /demos/embedded/anomaly
parent192a3c6d69b42f02aa9033c30502a6930cceb8f7 (diff)
downloadQt-75db37022a9fd479e2a446b57e774eaf8e3e73ea.zip
Qt-75db37022a9fd479e2a446b57e774eaf8e3e73ea.tar.gz
Qt-75db37022a9fd479e2a446b57e774eaf8e3e73ea.tar.bz2
Convert examples and demos to use Bearer Management.
Task-number: QTBUG-10439
Diffstat (limited to 'demos/embedded/anomaly')
-rw-r--r--demos/embedded/anomaly/anomaly.pro2
-rw-r--r--demos/embedded/anomaly/src/BrowserView.cpp33
-rw-r--r--demos/embedded/anomaly/src/BrowserView.h3
3 files changed, 20 insertions, 18 deletions
diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro
index 584e5cd..a786b46 100644
--- a/demos/embedded/anomaly/anomaly.pro
+++ b/demos/embedded/anomaly/anomaly.pro
@@ -26,8 +26,6 @@ RESOURCES += src/anomaly.qrc
symbian {
TARGET.UID3 = 0xA000CF71
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp
index a6e6f7a..73d0b70 100644
--- a/demos/embedded/anomaly/src/BrowserView.cpp
+++ b/demos/embedded/anomaly/src/BrowserView.cpp
@@ -51,10 +51,6 @@
#include "webview.h"
#include "ZoomStrip.h"
-#if defined (Q_OS_SYMBIAN)
-#include "sym_iap_util.h"
-#endif
-
BrowserView::BrowserView(QWidget *parent)
: QWidget(parent)
, m_titleBar(0)
@@ -71,6 +67,26 @@ BrowserView::BrowserView(QWidget *parent)
m_zoomLevels << 100;
m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
+ QNetworkConfigurationManager manager;
+ if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+ // Get saved network configuration
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ const QString id =
+ settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+ settings.endGroup();
+
+ // If the saved network configuration is not currently discovered use the system
+ // default
+ QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+ if ((config.state() & QNetworkConfiguration::Discovered) !=
+ QNetworkConfiguration::Discovered) {
+ config = manager.defaultConfiguration();
+ }
+
+ m_webView->page()->networkAccessManager()->setConfiguration(config);
+ }
+
QTimer::singleShot(0, this, SLOT(initialize()));
}
@@ -100,9 +116,6 @@ void BrowserView::initialize()
m_webView->setHtml("about:blank");
m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_webView->setFocus();
-#ifdef Q_OS_SYMBIAN
- QTimer::singleShot(0, this, SLOT(setDefaultIap()));
-#endif
}
void BrowserView::start()
@@ -173,12 +186,6 @@ void BrowserView::resizeEvent(QResizeEvent *event)
int zh = m_zoomStrip->sizeHint().height();
m_zoomStrip->move(width() - zw, (height() - zh) / 2);
}
-#ifdef Q_OS_SYMBIAN
-void BrowserView::setDefaultIap()
-{
- qt_SetDefaultIap();
-}
-#endif
void BrowserView::navigate(const QUrl &url)
{
diff --git a/demos/embedded/anomaly/src/BrowserView.h b/demos/embedded/anomaly/src/BrowserView.h
index 5ab1dd7..8981582 100644
--- a/demos/embedded/anomaly/src/BrowserView.h
+++ b/demos/embedded/anomaly/src/BrowserView.h
@@ -63,9 +63,6 @@ public slots:
void navigate(const QUrl &url);
void zoomIn();
void zoomOut();
-#ifdef Q_OS_SYMBIAN
- void setDefaultIap();
-#endif
private slots:
void initialize();