summaryrefslogtreecommitdiffstats
path: root/demos/embedded/anomaly/src/BrowserView.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-19 04:07:06 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-19 04:07:06 (GMT)
commit406f7cb7f7dd4d6d80ffb99335600aa776cc71e2 (patch)
tree1e37a53a42c30b87825cbab257a49dce3c0122d2 /demos/embedded/anomaly/src/BrowserView.cpp
parentdc37f4ff3439e44df65d24aea4354c80d2a02293 (diff)
parent75db37022a9fd479e2a446b57e774eaf8e3e73ea (diff)
downloadQt-406f7cb7f7dd4d6d80ffb99335600aa776cc71e2.zip
Qt-406f7cb7f7dd4d6d80ffb99335600aa776cc71e2.tar.gz
Qt-406f7cb7f7dd4d6d80ffb99335600aa776cc71e2.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Convert examples and demos to use Bearer Management. Fixes deployment rules for embedded qml demos application. Fix build on Symbian.
Diffstat (limited to 'demos/embedded/anomaly/src/BrowserView.cpp')
-rw-r--r--demos/embedded/anomaly/src/BrowserView.cpp33
1 files changed, 20 insertions, 13 deletions
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)
{