diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-07-20 00:16:27 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-07-20 00:16:27 (GMT) |
commit | 9a8ce2bd461f50fdcb7ac0ce658aac55a4bc4415 (patch) | |
tree | 27f91b1b5a2fa97ac30a0d7f178c5607988d2bf3 /demos/embedded/anomaly/src/BrowserView.cpp | |
parent | 17cc89e918a969d85d2b46631ee8743288c7586d (diff) | |
parent | 83d799a00dd4417f6d2efb02781e332f510dab6a (diff) | |
download | Qt-9a8ce2bd461f50fdcb7ac0ce658aac55a4bc4415.zip Qt-9a8ce2bd461f50fdcb7ac0ce658aac55a4bc4415.tar.gz Qt-9a8ce2bd461f50fdcb7ac0ce658aac55a4bc4415.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'demos/embedded/anomaly/src/BrowserView.cpp')
-rw-r--r-- | demos/embedded/anomaly/src/BrowserView.cpp | 33 |
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) { |