diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-01-04 23:06:49 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-01-04 23:45:12 (GMT) |
commit | 31e6fc5ae7f7fbe2f23b519cb76dcc579dac1f41 (patch) | |
tree | 0f013fe0a7407737aac96d8d0dab5ccf83815261 /tests/manual/bearerex | |
parent | 0f31f63e11d4fcb2b399979de28368a89275b911 (diff) | |
download | Qt-31e6fc5ae7f7fbe2f23b519cb76dcc579dac1f41.zip Qt-31e6fc5ae7f7fbe2f23b519cb76dcc579dac1f41.tar.gz Qt-31e6fc5ae7f7fbe2f23b519cb76dcc579dac1f41.tar.bz2 |
Bearer Management Integration 2.
Diffstat (limited to 'tests/manual/bearerex')
-rw-r--r-- | tests/manual/bearerex/bearerex.cpp | 37 | ||||
-rw-r--r-- | tests/manual/bearerex/bearerex.h | 3 | ||||
-rw-r--r-- | tests/manual/bearerex/bearerex.pro | 11 |
3 files changed, 22 insertions, 29 deletions
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp index 68590cc..f62d8d2 100644 --- a/tests/manual/bearerex/bearerex.cpp +++ b/tests/manual/bearerex/bearerex.cpp @@ -69,10 +69,6 @@ void BearerEx::createMenus() menuBar()->addAction(act1); connect(act1, SIGNAL(triggered()), this, SLOT(on_showDetailsButton_clicked())); - m_openAction = new QAction(tr("Open Session"), this); - menuBar()->addAction(m_openAction); - connect(m_openAction, SIGNAL(triggered()), this, SLOT(on_openSessionButton_clicked())); - QAction* exitAct = new QAction(tr("Exit"), this); menuBar()->addAction(exitAct); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); @@ -290,7 +286,7 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration, } else if (apNetworkConfiguration->type() == QNetworkConfiguration::ServiceNetwork) { snapLineEdit->setText(apNetworkConfiguration->name()+" ("+apNetworkConfiguration->identifier()+")"); } - bearerLineEdit->setText(m_NetworkSession->bearerName()); + bearerLineEdit->setText(apNetworkConfiguration->bearerName()); sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+ QString(" / ")+ QString::number(m_NetworkSession->bytesReceived())); @@ -341,7 +337,7 @@ void SessionTab::on_sendRequestButton_clicked() void SessionTab::on_openSessionButton_clicked() { m_NetworkSession->open(); - if (m_NetworkSession->isActive()) { + if (m_NetworkSession->isOpen()) { newState(m_NetworkSession->state()); } } @@ -349,7 +345,7 @@ void SessionTab::on_openSessionButton_clicked() void SessionTab::on_closeSessionButton_clicked() { m_NetworkSession->close(); - if (!m_NetworkSession->isActive()) { + if (!m_NetworkSession->isOpen()) { newState(m_NetworkSession->state()); } } @@ -418,7 +414,7 @@ void SessionTab::opened() listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+QString("Opened")); m_eventListWidget->addItem(listItem); - QVariant identifier = m_NetworkSession->property("ActiveConfigurationIdentifier"); + QVariant identifier = m_NetworkSession->property("ActiveConfiguration"); if (!identifier.isNull()) { QString configId = identifier.toString(); QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId); @@ -428,7 +424,7 @@ void SessionTab::opened() } if (m_NetworkSession->configuration().type() == QNetworkConfiguration::UserChoice) { - QVariant identifier = m_NetworkSession->property("UserChoiceConfigurationIdentifier"); + QVariant identifier = m_NetworkSession->property("UserChoiceConfiguration"); if (!identifier.isNull()) { QString configId = identifier.toString(); QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId); @@ -490,22 +486,21 @@ void SessionTab::stateChanged(QNetworkSession::State state) void SessionTab::newState(QNetworkSession::State state) { - if (state == QNetworkSession::Connected) { - QVariant identifier = m_NetworkSession->property("ActiveConfigurationIdentifier"); - if (!identifier.isNull()) { - QString configId = identifier.toString(); - QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId); - if (config.isValid()) { - iapLineEdit->setText(config.name()+" ("+config.identifier()+")"); - } + QVariant identifier = m_NetworkSession->property("ActiveConfiguration"); + if (state == QNetworkSession::Connected && !identifier.isNull()) { + QString configId = identifier.toString(); + QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId); + if (config.isValid()) { + iapLineEdit->setText(config.name()+" ("+config.identifier()+")"); + bearerLineEdit->setText(config.bearerName()); } + } else { + bearerLineEdit->setText(m_NetworkSession->configuration().bearerName()); } - bearerLineEdit->setText(m_NetworkSession->bearerName()); - QString active; - if (m_NetworkSession->isActive()) { - active = " (A)"; + if (m_NetworkSession->isOpen()) { + active = " (O)"; } stateLineEdit->setText(stateString(state)+active); } diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h index f18180e..b8a2393 100644 --- a/tests/manual/bearerex/bearerex.h +++ b/tests/manual/bearerex/bearerex.h @@ -51,7 +51,10 @@ #include "qnetworksession.h" #include "xqlistwidget.h" +QT_BEGIN_NAMESPACE class QHttp; +QT_END_NAMESPACE + class SessionTab; QTM_USE_NAMESPACE diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro index a870eb1..e480d43 100644 --- a/tests/manual/bearerex/bearerex.pro +++ b/tests/manual/bearerex/bearerex.pro @@ -24,11 +24,6 @@ SOURCES += bearerex.cpp \ main.cpp \ xqlistwidget.cpp -symbian: { - bearerex.sources = Qtbearer.dll - bearerex.path = /sys/bin - DEPLOYMENT += bearerex - - TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData -} -qtAddLibrary(QtBearer) +CONFIG += mobility +MOBILITY = bearer +symbian:TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData |