summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/qnetworksession_impl.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-05 00:51:25 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-08 07:48:22 (GMT)
commita307e9662c2b57ad16c2329754ea4795615de125 (patch)
tree48fe89e1c2edfda1e441a1db760ff63047cc209c /src/plugins/bearer/qnetworksession_impl.cpp
parentdf4b88078124fe993795bd436f3093b0120ffce2 (diff)
downloadQt-a307e9662c2b57ad16c2329754ea4795615de125.zip
Qt-a307e9662c2b57ad16c2329754ea4795615de125.tar.gz
Qt-a307e9662c2b57ad16c2329754ea4795615de125.tar.bz2
Remove implementation specific functions out of QNetworkSessionEngine.
Diffstat (limited to 'src/plugins/bearer/qnetworksession_impl.cpp')
-rw-r--r--src/plugins/bearer/qnetworksession_impl.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp
index a826fd6..6de3423 100644
--- a/src/plugins/bearer/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/qnetworksession_impl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,9 +40,9 @@
****************************************************************************/
#include "qnetworksession_impl.h"
+#include "qnetworksessionengine_impl.h"
#include <QtNetwork/qnetworksession.h>
-#include <QtNetwork/private/qnetworksessionengine_p.h>
#include <QtNetwork/private/qnetworkconfigmanager_p.h>
#include <QtCore/qstringlist.h>
@@ -53,13 +53,14 @@
QT_BEGIN_NAMESPACE
-static QNetworkSessionEngine *getEngineFromId(const QString &id)
+static QNetworkSessionEngineImpl *getEngineFromId(const QString &id)
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
foreach (QNetworkSessionEngine *engine, priv->sessionEngines) {
- if (engine->hasIdentifier(id))
- return engine;
+ QNetworkSessionEngineImpl *engineImpl = qobject_cast<QNetworkSessionEngineImpl *>(engine);
+ if (engineImpl && engineImpl->hasIdentifier(id))
+ return engineImpl;
}
return 0;
@@ -110,8 +111,8 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
state = QNetworkSession::Invalid;
lastError = QNetworkSession::UnknownSessionError;
- qRegisterMetaType<QNetworkSessionEngine::ConnectionError>
- ("QNetworkSessionEngine::ConnectionError");
+ qRegisterMetaType<QNetworkSessionEngineImpl::ConnectionError>
+ ("QNetworkSessionEngineImpl::ConnectionError");
switch (publicConfig.type()) {
case QNetworkConfiguration::InternetAccessPoint:
@@ -239,14 +240,6 @@ void QNetworkSessionPrivateImpl::setSessionProperty(const QString& /*key*/, cons
{
}
-/*QString QNetworkSessionPrivateImpl::bearerName() const
-{
- if (!publicConfig.isValid() || !engine)
- return QString();
-
- return engine->bearerName(activeConfig.identifier());
-}*/
-
QString QNetworkSessionPrivateImpl::errorString() const
{
switch (lastError) {
@@ -414,18 +407,19 @@ void QNetworkSessionPrivateImpl::forcedSessionClose(const QNetworkConfiguration
}
}
-void QNetworkSessionPrivateImpl::connectionError(const QString &id, QNetworkSessionEngine::ConnectionError error)
+void QNetworkSessionPrivateImpl::connectionError(const QString &id,
+ QNetworkSessionEngineImpl::ConnectionError error)
{
if (activeConfig.identifier() == id) {
networkConfigurationsChanged();
switch (error) {
- case QNetworkSessionEngine::OperationNotSupported:
+ case QNetworkSessionEngineImpl::OperationNotSupported:
lastError = QNetworkSession::OperationNotSupportedError;
opened = false;
break;
- case QNetworkSessionEngine::InterfaceLookupError:
- case QNetworkSessionEngine::ConnectError:
- case QNetworkSessionEngine::DisconnectionError:
+ case QNetworkSessionEngineImpl::InterfaceLookupError:
+ case QNetworkSessionEngineImpl::ConnectError:
+ case QNetworkSessionEngineImpl::DisconnectionError:
default:
lastError = QNetworkSession::UnknownSessionError;
}