diff options
Diffstat (limited to 'demos/embedded/anomaly/src')
| -rw-r--r-- | demos/embedded/anomaly/src/BookmarksView.cpp | 2 | ||||
| -rw-r--r-- | demos/embedded/anomaly/src/BrowserView.cpp | 34 | ||||
| -rw-r--r-- | demos/embedded/anomaly/src/BrowserView.h | 3 |
3 files changed, 21 insertions, 18 deletions
diff --git a/demos/embedded/anomaly/src/BookmarksView.cpp b/demos/embedded/anomaly/src/BookmarksView.cpp index 729bf73..d6e6035 100644 --- a/demos/embedded/anomaly/src/BookmarksView.cpp +++ b/demos/embedded/anomaly/src/BookmarksView.cpp @@ -55,7 +55,7 @@ BookmarksView::BookmarksView(QWidget *parent) m_iconView->addItem("www.google.com"); m_iconView->addItem("qt.nokia.com/doc/4.5"); - m_iconView->addItem("news.bbc.co.uk/text_only.stm"); + m_iconView->addItem("news.bbc.co.uk/2/mobile/default.stm"); m_iconView->addItem("mobile.wikipedia.org"); m_iconView->addItem("qt.nokia.com"); m_iconView->addItem("en.wikipedia.org"); diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp index 41318ad..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,13 +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(); - m_webView->load(QUrl("http://news.bbc.co.uk/text_only.stm")); -} -#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(); |
