summaryrefslogtreecommitdiffstats
path: root/examples/network/bearermonitor/sessionwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/bearermonitor/sessionwidget.cpp')
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index 7633dd7..0277d87 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "sessionwidget.h"
+#include "qnetworkconfigmanager.h"
SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *parent)
: QWidget(parent)
@@ -79,7 +80,13 @@ void SessionWidget::updateSession()
updateSessionState(session->state());
updateSessionError(session->error());
- bearer->setText(session->bearerName());
+ if (session->configuration().type() == QNetworkConfiguration::InternetAccessPoint)
+ bearer->setText(session->configuration().bearerName());
+ else {
+ QNetworkConfigurationManager mgr;
+ QNetworkConfiguration c = mgr.configurationFromIdentifier(session->sessionProperty("ActiveConfiguration").toString());
+ bearer->setText(c.bearerName());
+ }
interfaceName->setText(session->interface().humanReadableName());
interfaceGuid->setText(session->interface().name());
@@ -140,10 +147,10 @@ void SessionWidget::updateSessionState(QNetworkSession::State state)
s = s.arg(tr("Unknown"));
}
- if (session->isActive())
- s = s.arg(tr("Active"));
+ if (session->isOpen())
+ s = s.arg(tr("Open"));
else
- s = s.arg(tr("Inactive"));
+ s = s.arg(tr("Closed"));
sessionState->setText(s);
}