summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-03 06:39:37 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-03 06:39:37 (GMT)
commit29ec21be8f69b1275d7945235c15b4ee2750901d (patch)
treeb20e1f238a96dfc34234ab4d868a905e2735ed2f /examples
parent6b2a5c6f18cb766801a50db583e14a8e559e9bfb (diff)
parent972191f8e3bdbf702e11be8c0a72fca9e896f395 (diff)
downloadQt-29ec21be8f69b1275d7945235c15b4ee2750901d.zip
Qt-29ec21be8f69b1275d7945235c15b4ee2750901d.tar.gz
Qt-29ec21be8f69b1275d7945235c15b4ee2750901d.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: Return 'Unknown' bearer type name for unknown bearer type. Update def files. Doc: updating index page, x platform and platform spec. Removing redundant style files Added notice that some links are online documents. Modified qtdemo so error does not appear when there is no demo/example description availablei (QTBUG-12522). There is already output when building Qt that a description is missing -- the user does not need to witness an error about ensuring the documentation has been built just because a description has not been contributed. Fix Japanese characters not displayed in webkit on Mac Cocoa 64 (Regression) configure: don't symlink the mkspecs/features directory Doc: adding changes to getting started and fixing redirection links doc: Fixed many qdoc errors. Fixed potential infinite loop in QFileSystemWatcher on Mac. qdoc: Removed exclusion of declarative directories in qt-api-only.qdocconf Fixed comment about all enums being accessible in QML. Fix for QTBUG-12527. Simplify network manager settings code. Use an enum to return the bearer type of a network configuration. Rename QNetworkConfiguration::bearerName() function.
Diffstat (limited to 'examples')
-rw-r--r--examples/network/bearercloud/cloud.cpp34
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp4
2 files changed, 23 insertions, 15 deletions
diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp
index 980efbf..8deaab3 100644
--- a/examples/network/bearercloud/cloud.cpp
+++ b/examples/network/bearercloud/cloud.cpp
@@ -53,7 +53,7 @@
#include <math.h>
-static QMap<QString, QSvgRenderer *> svgCache;
+static QMap<QNetworkConfiguration::BearerType, QSvgRenderer *> svgCache;
//! [0]
Cloud::Cloud(const QNetworkConfiguration &config, QGraphicsItem *parent)
@@ -261,9 +261,9 @@ void Cloud::stateChanged(QNetworkSession::State state)
tooltip += tr("<br>Id: %1").arg(configuration.identifier());
#endif
- const QString bearerName = configuration.bearerName();
- if (!bearerName.isEmpty())
- tooltip += tr("<br>Bearer: %1").arg(bearerName);
+ const QString bearerTypeName = configuration.bearerTypeName();
+ if (!bearerTypeName.isEmpty())
+ tooltip += tr("<br>Bearer: %1").arg(bearerTypeName);
QString s = tr("<br>State: %1 (%2)");
switch (state) {
@@ -313,17 +313,25 @@ void Cloud::stateChanged(QNetworkSession::State state)
//! [1]
void Cloud::newConfigurationActivated()
{
- const QString bearerName = configuration.bearerName();
- if (!svgCache.contains(bearerName)) {
- if (bearerName == QLatin1String("WLAN"))
- svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":wlan.svg")));
- else if (bearerName == QLatin1String("Ethernet"))
- svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":lan.svg")));
- else
- svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":unknown.svg")));
+ QNetworkConfiguration::BearerType bearerType = configuration.bearerType();
+ if (!svgCache.contains(bearerType)) {
+ QSvgRenderer *renderer = 0;
+ switch (bearerType) {
+ case QNetworkConfiguration::BearerWLAN:
+ renderer = new QSvgRenderer(QLatin1String(":wlan.svg"));
+ break;
+ case QNetworkConfiguration::BearerEthernet:
+ renderer = new QSvgRenderer(QLatin1String(":lan.svg"));
+ break;
+ default:
+ renderer = new QSvgRenderer(QLatin1String(":unknown.svg"));
+ }
+
+ if (renderer)
+ svgCache.insert(bearerType, renderer);
}
- icon->setSharedRenderer(svgCache[bearerName]);
+ icon->setSharedRenderer(svgCache[bearerType]);
if (configuration.name().isEmpty()) {
text->setPlainText(tr("HIDDEN NETWORK"));
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index 8b5693a..ecc2a93 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -111,11 +111,11 @@ void SessionWidget::updateSession()
killTimer(statsTimer);
if (session->configuration().type() == QNetworkConfiguration::InternetAccessPoint)
- bearer->setText(session->configuration().bearerName());
+ bearer->setText(session->configuration().bearerTypeName());
else {
QNetworkConfigurationManager mgr;
QNetworkConfiguration c = mgr.configurationFromIdentifier(session->sessionProperty("ActiveConfiguration").toString());
- bearer->setText(c.bearerName());
+ bearer->setText(c.bearerTypeName());
}
#ifndef QT_NO_NETWORKINTERFACE