summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-08-02 14:17:39 +0100
committerShane Kearns <shane.kearns@accenture.com>2011-10-03 17:16:46 +0100
commita72b05efbbdd6267bfb84f738f52d263ddf1ef1b (patch)
tree229148c67d69f367c76b3c8373e481630f540b86 /tests
parent241038e4990bab94ff9d3f0f059901d5dea7b02f (diff)
Replace QtBearer implementation with a shim over QtNetwork
The bearer management API was integrated into QtNetwork 4.7 This change removes the parallel implementation from QtBearer and inserts a shim for binary compatibility. Applications which linked against QtBearer will now be using the implementation from QtNetwork transparently. QNetworkSession had a private 'd' pointer, the private class is changed to contain a ::QNetworkSession, and API calls are redirected. Signals are connected to the signals of the outer class, or through translation slots of the inner class where casting is required. QNetworkConfigurationManager had no 'd' pointer, but a global static private implementation. This is similarly changed to contain a ::QNetworkConfigurationManager which is used to redirect API calls. Qt's meta object system can't distinguish between QNetworkConfiguration and QtMobility::QNetworkConfiguration. This is because the signals in QtBearer were declared without including the namespace in the parameters. MOC doesn't understand c++ namespaces properly. As QVariants can be cast to the wrong type, a different approach is taken for QNetworkConfiguration to avoid crashes when using QSignalSpy or queued connections. QNetworkConfiguration now derives from ::QNetworkConfiguration. The QNetworkConfiguration 'd' pointer is removed (the Qt class has a 'd' pointer) This makes the two classes bitwise identical except for the vtable for the virtual destructor. QtMobility::QNetworkConfiguration APIs just base-call the Qt class. There is a new private constructor to allow a QtMobility::QNetworkConfiguration to be constructed from a Qt one. The two virtual adaptor classes exist to avoid namespace conflicts QtBearer no longer exports any header files. This version of QtBearer has a dependency on Qt 4.7 or higher, and the Qt headers include the QtMobility version of the API already. Exporting the QtBearer headers causes compile errors in case an application picked up the wrong header files. Testing: Ran qt bearer autotests on symbian3, compiled and run against qt 4.8 and this version of qt mobility. Ran qt bearer autotests on symbian3, compiled against qt 4.6.3 and qt mobility 1.0.2; run against qt 4.8 and this version of qt mobility. Also ran these same tests with win32-msvc2008 and linux-gcc desktop platforms.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qnetworkconfigmanager/qnetworkconfigmanager.pro2
-rw-r--r--tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp4
-rw-r--r--tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro2
-rw-r--r--tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp4
-rw-r--r--tests/auto/qnetworksession/lackey/main.cpp6
-rw-r--r--tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp4
-rw-r--r--tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro2
7 files changed, 9 insertions, 15 deletions
diff --git a/tests/auto/qnetworkconfigmanager/qnetworkconfigmanager.pro b/tests/auto/qnetworkconfigmanager/qnetworkconfigmanager.pro
index 87dc1f3f00..1d023f2c7b 100644
--- a/tests/auto/qnetworkconfigmanager/qnetworkconfigmanager.pro
+++ b/tests/auto/qnetworkconfigmanager/qnetworkconfigmanager.pro
@@ -5,8 +5,6 @@ CONFIG += testcase
QT = core network
-INCLUDEPATH += ../../../src/bearer
-
include(../../../common.pri)
CONFIG += mobility
MOBILITY = bearer
diff --git a/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp b/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
index 899f728c3a..52304c4e98 100644
--- a/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
+++ b/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
@@ -43,8 +43,8 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
-#include "../../../src/bearer/qnetworkconfiguration.h"
-#include "../../../src/bearer/qnetworkconfigmanager.h"
+#include <QNetworkConfiguration>
+#include <QNetworkConfigurationManager>
#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
#include <stdio.h>
diff --git a/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro b/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro
index ca11aaf61a..e228a413e1 100644
--- a/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro
+++ b/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro
@@ -5,8 +5,6 @@ CONFIG += testcase
QT = core network
-INCLUDEPATH += ../../../src/bearer
-
include(../../../common.pri)
CONFIG += mobility
MOBILITY = bearer
diff --git a/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index e3c17ffde8..5c23ea87d4 100644
--- a/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -43,8 +43,8 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
-#include "../../../src/bearer/qnetworkconfiguration.h"
-#include "../../../src/bearer/qnetworkconfigmanager.h"
+#include <QNetworkConfiguration>
+#include <QNetworkConfigurationManager>
/*
Although this unit test doesn't use QNetworkAccessManager
diff --git a/tests/auto/qnetworksession/lackey/main.cpp b/tests/auto/qnetworksession/lackey/main.cpp
index 0fa666f0a9..ac57c465ec 100644
--- a/tests/auto/qnetworksession/lackey/main.cpp
+++ b/tests/auto/qnetworksession/lackey/main.cpp
@@ -42,9 +42,9 @@
#include <QCoreApplication>
#include <QStringList>
#include <QLocalSocket>
-#include "../../../../src/bearer/qnetworkconfigmanager.h"
-#include "../../../../src/bearer/qnetworkconfiguration.h"
-#include "../../../../src/bearer/qnetworksession.h"
+#include <QNetworkConfigurationManager>
+#include <QNetworkConfiguration>
+#include <QNetworkSession>
#include <QEventLoop>
#include <QTimer>
diff --git a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp
index 5729d87fa6..5ea9812e65 100644
--- a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp
@@ -46,8 +46,8 @@
#include <QLocalSocket>
#include <QTimer>
#include "../../qbearertestcommon.h"
-#include "../../../../src/bearer/qnetworkconfigmanager.h"
-#include "../../../../src/bearer/qnetworksession.h"
+#include <QNetworkConfigurationManager>
+#include <QNetworkSession>
#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
#include <stdio.h>
diff --git a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro
index 06067e4d7d..1ca0d803cc 100644
--- a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro
+++ b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro
@@ -5,8 +5,6 @@ CONFIG += testcase
QT = core network
-INCLUDEPATH += ../../../../src/bearer
-
include(../../../../common.pri)
CONFIG += mobility
MOBILITY = bearer