diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-14 16:02:08 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-14 16:02:08 (GMT) |
commit | 0f4505dd18a1342b62a049d4c37414179d6ec065 (patch) | |
tree | 3be71264d34e2ec7534a404634ae39f3cf47d497 /src/plugins/bearer/icd/qnetworksession_impl.h | |
parent | b371999d3e9c207047be6afda89d008b6cf04763 (diff) | |
parent | 8876c7c44744b0813f98ebbb0f748331f9d8a22c (diff) | |
download | Qt-0f4505dd18a1342b62a049d4c37414179d6ec065.zip Qt-0f4505dd18a1342b62a049d4c37414179d6ec065.tar.gz Qt-0f4505dd18a1342b62a049d4c37414179d6ec065.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (21 commits)
Added missing newline after warning message when using -L with qml
Doc: updating scripts
Fixed a crash on embedded due to uninitialized pointer.
Fix a race where QThread::exit() is "lost" when called after start()
qdoc: Removed all <table> attributes in favor of using css.
Autotest failure: dialogModality test fails on cocoa (macgui)
Force the bic test to compile in 32-bit mode on Mac
Revert "Doc: Updating design files."
Remove statically allocated pixmaps through the post routine
qdoc: Checked for empty title.
qdoc: Added TOC to class ref pages.
Cocoa: qwidget autotest fails on setToolTip
Compile on Mac OS 10.4
Bearer management changes from Qt Mobility (7a5ff985)
Partially revert "Sunstudio12.1(5.10): Fix compile errors GTK style and other minor compile errors"
Fix margins for placeholdertext in QLineEdit
qdoc: Added TOC to module pages.
Doc: Updating design files.
Doc: Fixing design bugs. Updating the index page and script/style files. Adding some image files.
qdoc: Changed <ul> elements in TOC.
...
Diffstat (limited to 'src/plugins/bearer/icd/qnetworksession_impl.h')
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.h | 73 |
1 files changed, 69 insertions, 4 deletions
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.h b/src/plugins/bearer/icd/qnetworksession_impl.h index c02faac..d15f401 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.h +++ b/src/plugins/bearer/icd/qnetworksession_impl.h @@ -57,6 +57,12 @@ #include <QtNetwork/qnetworkconfigmanager.h> #include <QtCore/qdatetime.h> +#include <QtCore/qtimer.h> + +#include <QtDBus/qdbusconnection.h> +#include <QtDBus/qdbusinterface.h> +#include <QtDBus/qdbusmessage.h> +#include <QtDBus/qdbusmetatype.h> #include <icd/dbus_api.h> @@ -64,14 +70,52 @@ QT_BEGIN_NAMESPACE class QIcdEngine; +struct ICd2DetailsDBusStruct +{ + QString serviceType; + uint serviceAttributes; + QString setviceId; + QString networkType; + uint networkAttributes; + QByteArray networkId; +}; + +typedef QList<ICd2DetailsDBusStruct> ICd2DetailsList; + class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate { Q_OBJECT public: QNetworkSessionPrivateImpl(QIcdEngine *engine) - : engine(engine), connectFlags(ICD_CONNECTION_FLAG_USER_EVENT), currentState(QNetworkSession::Invalid) + : engine(engine), + connectFlags(ICD_CONNECTION_FLAG_USER_EVENT), + currentState(QNetworkSession::Invalid), + m_asynchCallActive(false) { + m_stopTimer.setSingleShot(true); + connect(&m_stopTimer, SIGNAL(timeout()), this, SLOT(finishStopBySendingClosedSignal())); + + QDBusConnection systemBus = QDBusConnection::systemBus(); + + m_dbusInterface = new QDBusInterface(ICD_DBUS_API_INTERFACE, + ICD_DBUS_API_PATH, + ICD_DBUS_API_INTERFACE, + systemBus, + this); + + systemBus.connect(ICD_DBUS_API_INTERFACE, + ICD_DBUS_API_PATH, + ICD_DBUS_API_INTERFACE, + ICD_DBUS_API_CONNECT_SIG, + this, + SLOT(stateChange(const QDBusMessage&))); + + qDBusRegisterMetaType<ICd2DetailsDBusStruct>(); + qDBusRegisterMetaType<ICd2DetailsList>(); + + m_connectRequestTimer.setSingleShot(true); + connect(&m_connectRequestTimer, SIGNAL(timeout()), this, SLOT(connectTimeout())); } ~QNetworkSessionPrivateImpl() @@ -114,16 +158,21 @@ private: private Q_SLOTS: void do_open(); void networkConfigurationsChanged(); - void configurationChanged(const QNetworkConfiguration &config); + void iapStateChanged(const QString& iapid, uint icd_connection_state); void updateProxies(QNetworkSession::State newState); + void finishStopBySendingClosedSignal(); + void stateChange(const QDBusMessage& rep); + void connectTimeout(); private: QNetworkConfigurationManager manager; QIcdEngine *engine; + // The config set on QNetworkSession. + QNetworkConfiguration config; + QNetworkConfiguration& copyConfig(QNetworkConfiguration &fromConfig, QNetworkConfiguration &toConfig, bool deepCopy = true); void clearConfiguration(QNetworkConfiguration &config); - void cleanupAnyConfiguration(); bool opened; icd_connection_flags connectFlags; @@ -134,15 +183,31 @@ private: QString currentNetworkInterface; friend class IcdListener; void updateState(QNetworkSession::State); - void updateIdentifier(QString &newId); + void updateIdentifier(const QString &newId); quint64 getStatistics(bool sent) const; void cleanupSession(void); void updateProxyInformation(); void clearProxyInformation(); QNetworkSession::State currentState; + + QDBusInterface *m_dbusInterface; + + QTimer m_stopTimer; + + bool m_asynchCallActive; + QTimer m_connectRequestTimer; }; +// Marshall the ICd2DetailsDBusStruct data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const ICd2DetailsDBusStruct &icd2); + +// Retrieve the ICd2DetailsDBusStruct data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, ICd2DetailsDBusStruct &icd2); + +Q_DECLARE_METATYPE(ICd2DetailsDBusStruct); +Q_DECLARE_METATYPE(ICd2DetailsList); + QT_END_NAMESPACE #endif //QNETWORKSESSIONPRIVATE_H |