Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/demos/embedded/anomaly/src/BrowserView.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5252#include "ZoomStrip.h"
    5353
    54 #if defined (Q_OS_SYMBIAN)
    55 #include "sym_iap_util.h"
    56 #endif
    57 
    5854BrowserView::BrowserView(QWidget *parent)
    5955    : QWidget(parent)
     
    7167    m_zoomLevels << 100;
    7268    m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
     69
     70    QNetworkConfigurationManager manager;
     71    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
     72        // Get saved network configuration
     73        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
     74        settings.beginGroup(QLatin1String("QtNetwork"));
     75        const QString id =
     76            settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
     77        settings.endGroup();
     78
     79        // If the saved network configuration is not currently discovered use the system
     80        // default
     81        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
     82        if ((config.state() & QNetworkConfiguration::Discovered) !=
     83            QNetworkConfiguration::Discovered) {
     84            config = manager.defaultConfiguration();
     85        }
     86
     87        m_webView->page()->networkAccessManager()->setConfiguration(config);
     88    }
    7389
    7490    QTimer::singleShot(0, this, SLOT(initialize()));
     
    101117    m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    102118    m_webView->setFocus();
    103 #ifdef Q_OS_SYMBIAN
    104     QTimer::singleShot(0, this, SLOT(setDefaultIap()));
    105 #endif
    106119}
    107120
     
    174187    m_zoomStrip->move(width() - zw, (height() - zh) / 2);
    175188}
    176 #ifdef Q_OS_SYMBIAN
    177 void BrowserView::setDefaultIap()
    178 {
    179     qt_SetDefaultIap();
    180     m_webView->load(QUrl("http://news.bbc.co.uk/text_only.stm"));
    181 }
    182 #endif
    183189
    184190void BrowserView::navigate(const QUrl &url)
Note: See TracChangeset for help on using the changeset viewer.