diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-08-02 14:17:39 +0100 |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-10-03 17:16:46 +0100 |
commit | a72b05efbbdd6267bfb84f738f52d263ddf1ef1b (patch) | |
tree | 229148c67d69f367c76b3c8373e481630f540b86 /tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp | |
parent | 241038e4990bab94ff9d3f0f059901d5dea7b02f (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/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp')
-rw-r--r-- | tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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> |