summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-29 08:59:32 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-29 08:59:32 (GMT)
commitc02ef9eb331f03dbd59d2fd938c53b54f5c65cea (patch)
tree93defa0a21c2ecc1261c5d549087916a69cb4f55 /src/plugins
parent60d37c9c2f99ee1b10293c4dbc0264664dd8cad0 (diff)
parent60948c48adc376cefa774bd101de34c60db52dea (diff)
downloadQt-c02ef9eb331f03dbd59d2fd938c53b54f5c65cea.zip
Qt-c02ef9eb331f03dbd59d2fd938c53b54f5c65cea.tar.gz
Qt-c02ef9eb331f03dbd59d2fd938c53b54f5c65cea.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: (25 commits) QNAM: Fix doc rendering of QNetworkRequest remove the connecting thread, and use async call to dbus instead. QScriptValue::construct(): Don't crash if function throws non-Object Network code: Fix code comment spellchecking errors. QNAM: fix build QNAM HTTP: Remove the error() of QHttpNetworkConnection QNAM HTTP: Remove enableEncryption() QNAM HTTP: Remove unused code QNAM HTTP: Move authenticationRequired() to QHttpNetworkReply QNAM HTTP: Move proxyAuthenticationRequired() to QHttpNetworkReply QNAM HTTP: Move cacheCredentials() to QHttpNetworkReply QNAM HTTP: Use sslErrors() from QHttpNetworkReply QNAM HTTP: Remove Wait4AuthState QNAM: Internal function renaming QNAM HTTP: Internal variable spelling mistakes QNAM HTTP: Pause connection when emitting proxy auth signal QNAM HTTP: Also pause connection when emitting sslErrors() QNAM HTTP: Also resume uploads after connection pause QNAM HTTP: Process authenticationRequired() from HTTP properly QNAM HTTP: Pause sockets while emitting to user code. ...
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp83
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.h27
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp21
-rw-r--r--src/plugins/bearer/connman/qofonoservice_linux.cpp12
4 files changed, 36 insertions, 107 deletions
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index a8b8911..184ceb4 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -170,13 +170,26 @@ bool QConnmanEngine::hasIdentifier(const QString &id)
void QConnmanEngine::connectToId(const QString &id)
{
QMutexLocker locker(&mutex);
- QConnmanConnectThread *thread;
- thread = new QConnmanConnectThread(this);
- thread->setServicePath(serviceFromId(id));
- thread->setIdentifier(id);
- connect(thread,SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)),
- this,SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)));
- thread->start();
+ QString servicePath = serviceFromId(id);
+ QConnmanServiceInterface serv(servicePath);
+ if(!serv.isValid()) {
+ emit connectionError(id, QBearerEngineImpl::InterfaceLookupError);
+ } else {
+ if(serv.getType() != "cellular") {
+
+ serv.connect();
+ } else {
+ QOfonoManagerInterface ofonoManager(0);
+ QString modemPath = ofonoManager.currentModem().path();
+ QOfonoDataConnectionManagerInterface dc(modemPath,0);
+ foreach(const QDBusObjectPath dcPath,dc.getPrimaryContexts()) {
+ if(dcPath.path().contains(servicePath.section("_",-1))) {
+ QOfonoPrimaryDataContextInterface primaryContext(dcPath.path(),0);
+ primaryContext.setActive(true);
+ }
+ }
+ }
+ }
}
void QConnmanEngine::disconnectFromId(const QString &id)
@@ -791,62 +804,6 @@ bool QConnmanEngine::requiresPolling() const
return false;
}
-
-QConnmanConnectThread::QConnmanConnectThread(QObject *parent)
- :QThread(parent),
- servicePath(), identifier()
-{
-}
-
-QConnmanConnectThread::~QConnmanConnectThread()
-{
-}
-
-void QConnmanConnectThread::stop()
-{
- if(currentThread() != this) {
- QMetaObject::invokeMethod(this, "quit",
- Qt::QueuedConnection);
- } else {
- quit();
- }
- wait();
-}
-
-void QConnmanConnectThread::run()
-{
- QConnmanServiceInterface serv(servicePath);
- if(!serv.isValid()) {
- emit connectionError(identifier, QBearerEngineImpl::InterfaceLookupError);
- } else {
- if(serv.getType() != "cellular") {
- serv.connect();
- } else {
- QOfonoManagerInterface ofonoManager(0);
- QString modemPath = ofonoManager.currentModem().path();
- QOfonoDataConnectionManagerInterface dc(modemPath,0);
- foreach(const QDBusObjectPath dcPath,dc.getPrimaryContexts()) {
- if(dcPath.path().contains(servicePath.section("_",-1))) {
- QOfonoPrimaryDataContextInterface primaryContext(dcPath.path(),0);
- primaryContext.setActive(true);
- }
- }
- }
- }
-}
-
-void QConnmanConnectThread::setServicePath(const QString &path)
-{
- QMutexLocker locker(&mutex);
- servicePath = path;
-}
-
-void QConnmanConnectThread::setIdentifier(const QString &id)
-{
- QMutexLocker locker(&mutex);
- identifier = id;
-}
-
QT_END_NAMESPACE
#endif // QT_NO_DBUS
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index 569bbc7..2a2308f 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -59,14 +59,12 @@
#include <QMap>
#include <QVariant>
-#include <QtCore/qthread.h>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
-class QConnmanConnectThread;
class QConnmanEngine : public QBearerEngineImpl
{
Q_OBJECT
@@ -141,33 +139,8 @@ private:
bool isRoamingAllowed(const QString &context);
protected:
bool requiresPolling() const;
- QConnmanConnectThread *connThread;
};
-class QConnmanConnectThread : public QThread
-{
- Q_OBJECT
-
-public:
- QConnmanConnectThread(QObject *parent = 0);
- ~QConnmanConnectThread();
- bool keepRunning;
- void stop();
- void setServicePath(const QString &path);
- void setIdentifier(const QString &id);
-
-Q_SIGNALS:
- void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error);
-
-protected:
- void run();
- QString servicePath;
- QString identifier;
-
-private:
- QMutex mutex;
-
-};
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 549a07a..46b6e80 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -79,7 +79,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QLatin1String(CONNMAN_MANAGER_PATH),
QLatin1String(CONNMAN_MANAGER_INTERFACE),
QLatin1String("PropertyChanged"),
- this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) {
+ this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & ))), Qt::UniqueConnection) {
qWarning() << "PropertyCHanged not connected";
}
}
@@ -89,7 +89,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QLatin1String(CONNMAN_MANAGER_PATH),
QLatin1String(CONNMAN_MANAGER_INTERFACE),
QLatin1String("StateChanged"),
- this,SIGNAL(stateChanged(const QString&)))) {
+ this,SIGNAL(stateChanged(const QString&))), Qt::UniqueConnection) {
qWarning() << "StateChanged not connected";
}
@@ -106,7 +106,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -338,7 +338,7 @@ void QConnmanNetworkInterface::connectNotify(const char *signal)
this->path(),
QLatin1String(CONNMAN_NETWORK_INTERFACE),
QLatin1String("PropertyChanged"),
- this,SIGNAL(propertyChanged(QString,QDBusVariant))) ) {
+ this,SIGNAL(propertyChanged(QString,QDBusVariant))), Qt::UniqueConnection) {
qWarning() << "network properties not connected";
}
}
@@ -350,10 +350,10 @@ void QConnmanNetworkInterface::connectNotify(const char *signal)
this->path(),
QLatin1String(CONNMAN_NETWORK_INTERFACE),
QLatin1String("PropertyChanged"),
- helper,SLOT(propertyChanged(QString,QDBusVariant)));
+ helper,SLOT(propertyChanged(QString,QDBusVariant))), Qt::UniqueConnection;
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -538,7 +538,7 @@ void QConnmanServiceInterface::connectNotify(const char *signal)
helper,SLOT(propertyChanged(QString,QDBusVariant)));
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -569,10 +569,9 @@ QVariant QConnmanServiceInterface::getProperty(const QString &property)
return var;
}
-// clearProperty
void QConnmanServiceInterface::connect()
{
- QDBusReply<QVariantMap> reply = this->call(QLatin1String("Connect"));
+ this->asyncCall(QLatin1String("Connect"));
}
void QConnmanServiceInterface::disconnect()
@@ -866,7 +865,7 @@ void QConnmanTechnologyInterface::connectNotify(const char *signal)
helper,SLOT(propertyChanged(QString,QDBusVariant)));
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -1031,7 +1030,7 @@ void QConnmanDeviceInterface::connectNotify(const char *signal)
helper,SLOT(propertyChanged(QString,QDBusVariant)));
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
diff --git a/src/plugins/bearer/connman/qofonoservice_linux.cpp b/src/plugins/bearer/connman/qofonoservice_linux.cpp
index 955f4b1..52f596b 100644
--- a/src/plugins/bearer/connman/qofonoservice_linux.cpp
+++ b/src/plugins/bearer/connman/qofonoservice_linux.cpp
@@ -262,7 +262,7 @@ void QOfonoModemInterface::connectNotify(const char *signal)
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}}
void QOfonoModemInterface::disconnectNotify(const char *signal)
@@ -385,7 +385,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -483,7 +483,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -586,7 +586,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -675,7 +675,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}
@@ -794,7 +794,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
- this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+ this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection);
}
}