diff options
-rw-r--r-- | src/plugins/bearer/connman/qconnmanservice_linux.cpp | 68 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qconnmanservice_linux_p.h | 20 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qofonoservice_linux.cpp | 270 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qofonoservice_linux_p.h | 32 |
4 files changed, 220 insertions, 170 deletions
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index 3ee67ed38f..83f9ff1903 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp +++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp @@ -72,9 +72,10 @@ QConnmanManagerInterface::~QConnmanManagerInterface() { } -void QConnmanManagerInterface::connectNotify(const char *signal) +void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanManagerInterface::propertyChanged); + if (signal == propertyChangedSignal) { if(!connection().connect(QLatin1String(CONNMAN_SERVICE), QLatin1String(CONNMAN_MANAGER_PATH), QLatin1String(CONNMAN_MANAGER_INTERFACE), @@ -84,7 +85,8 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } - if (QLatin1String(signal) == SIGNAL(stateChanged(QString))) { + static const QMetaMethod stateChangedSignal = QMetaMethod::fromSignal(&QConnmanManagerInterface::stateChanged); + if (signal == stateChangedSignal) { if (!connection().connect(QLatin1String(CONNMAN_SERVICE), QLatin1String(CONNMAN_MANAGER_PATH), QLatin1String(CONNMAN_MANAGER_INTERFACE), @@ -94,7 +96,8 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QConnmanManagerInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QConnmanDBusHelper *helper; helper = new QConnmanDBusHelper(this); @@ -110,9 +113,10 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } -void QConnmanManagerInterface::disconnectNotify(const char *signal) +void QConnmanManagerInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanManagerInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -331,9 +335,10 @@ QConnmanProfileInterface::~QConnmanProfileInterface() { } -void QConnmanProfileInterface::connectNotify(const char *signal) +void QConnmanProfileInterface::connectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanProfileInterface::propertyChanged); + if (signal == propertyChangedSignal) { dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_PROFILE_INTERFACE), @@ -342,9 +347,10 @@ void QConnmanProfileInterface::connectNotify(const char *signal) } } -void QConnmanProfileInterface::disconnectNotify(const char *signal) +void QConnmanProfileInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString, QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanProfileInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -399,16 +405,18 @@ QConnmanServiceInterface::~QConnmanServiceInterface() { } -void QConnmanServiceInterface::connectNotify(const char *signal) +void QConnmanServiceInterface::connectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanServiceInterface::propertyChanged); + if (signal == propertyChangedSignal) { dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_SERVICE_INTERFACE), QLatin1String("PropertyChanged"), this,SIGNAL(propertyChanged(QString,QDBusVariant))); } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QConnmanServiceInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QConnmanDBusHelper *helper; helper = new QConnmanDBusHelper(this); @@ -423,9 +431,10 @@ void QConnmanServiceInterface::connectNotify(const char *signal) } } -void QConnmanServiceInterface::disconnectNotify(const char *signal) +void QConnmanServiceInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanServiceInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -726,16 +735,18 @@ QConnmanTechnologyInterface::~QConnmanTechnologyInterface() { } -void QConnmanTechnologyInterface::connectNotify(const char *signal) +void QConnmanTechnologyInterface::connectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanTechnologyInterface::propertyChanged); + if (signal == propertyChangedSignal) { dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE), QLatin1String("PropertyChanged"), this,SIGNAL(propertyChanged(QString,QDBusVariant))); } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QConnmanTechnologyInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QConnmanDBusHelper *helper; helper = new QConnmanDBusHelper(this); @@ -750,9 +761,10 @@ void QConnmanTechnologyInterface::connectNotify(const char *signal) } } -void QConnmanTechnologyInterface::disconnectNotify(const char *signal) +void QConnmanTechnologyInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanTechnologyInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -806,22 +818,26 @@ QConnmanAgentInterface::~QConnmanAgentInterface() { } -void QConnmanAgentInterface::connectNotify(const char *signal) +void QConnmanAgentInterface::connectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanAgentInterface::propertyChanged); +// if (signal == propertyChangedSignal) { // dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), // this->path(), // QLatin1String(CONNMAN_NETWORK_INTERFACE), // QLatin1String("PropertyChanged"), // this,SIGNAL(propertyChanged(const QString &, QVariant &))); - } +// } } -void QConnmanAgentInterface::disconnectNotify(const char *signal) +void QConnmanAgentInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString, QDBusVariant))) { + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanAgentInterface::propertyChanged); +// if (signal == propertyChangedSignal) { - } +// } } diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h index 5a1778605e..3e5915c8f4 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux_p.h +++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h @@ -144,8 +144,8 @@ Q_SIGNALS: void propertyChangedContext(const QString &,const QString &,const QDBusVariant &); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -171,8 +171,8 @@ private: QConnmanProfileInterfacePrivate *d; protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -233,8 +233,8 @@ Q_SIGNALS: void propertyChangedContext(const QString &,const QString &,const QDBusVariant &); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -257,8 +257,8 @@ Q_SIGNALS: void propertyChanged(const QString &, const QDBusVariant &value); void propertyChangedContext(const QString &,const QString &,const QDBusVariant &); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -277,8 +277,8 @@ public: // dict requestInput(QDBusObjectPath &path, dict fields); void cancel(); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); }; class QConnmanCounterInterfacePrivate; diff --git a/src/plugins/bearer/connman/qofonoservice_linux.cpp b/src/plugins/bearer/connman/qofonoservice_linux.cpp index 5fe6ae0f88..94c8b83e4e 100644 --- a/src/plugins/bearer/connman/qofonoservice_linux.cpp +++ b/src/plugins/bearer/connman/qofonoservice_linux.cpp @@ -88,9 +88,10 @@ QDBusObjectPath QOfonoManagerInterface::currentModem() } -void QOfonoManagerInterface::connectNotify(const char *signal) +void QOfonoManagerInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoManagerInterface::propertyChanged); + if (signal == propertyChangedSignal) { if(!connection().connect(QLatin1String(OFONO_SERVICE), QLatin1String(OFONO_MANAGER_PATH), QLatin1String(OFONO_MANAGER_INTERFACE), @@ -100,7 +101,8 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoManagerInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QOfonoDBusHelper *helper; helper = new QOfonoDBusHelper(this); @@ -116,9 +118,10 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } -void QOfonoManagerInterface::disconnectNotify(const char *signal) +void QOfonoManagerInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoManagerInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -238,9 +241,10 @@ QString QOfonoModemInterface::defaultInterface() } -void QOfonoModemInterface::connectNotify(const char *signal) +void QOfonoModemInterface::connectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoModemInterface::propertyChanged); + if (signal == propertyChangedSignal) { if(!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_MODEM_INTERFACE), @@ -250,7 +254,8 @@ void QOfonoModemInterface::connectNotify(const char *signal) } } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoModemInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QOfonoDBusHelper *helper; helper = new QOfonoDBusHelper(this); @@ -265,9 +270,10 @@ void QOfonoModemInterface::connectNotify(const char *signal) this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection); }} -void QOfonoModemInterface::disconnectNotify(const char *signal) +void QOfonoModemInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoModemInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -361,9 +367,10 @@ QList <QDBusObjectPath> QOfonoNetworkRegistrationInterface::getOperators() return qdbus_cast<QList <QDBusObjectPath> >(var); } -void QOfonoNetworkRegistrationInterface::connectNotify(const char *signal) +void QOfonoNetworkRegistrationInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoNetworkRegistrationInterface::propertyChanged); + if (signal == propertyChangedSignal) { if(!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_NETWORK_REGISTRATION_INTERFACE), @@ -373,7 +380,8 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoNetworkRegistrationInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QOfonoDBusHelper *helper; helper = new QOfonoDBusHelper(this); @@ -389,9 +397,10 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { } } -void QOfonoNetworkRegistrationInterface::disconnectNotify(const char *signal) +void QOfonoNetworkRegistrationInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoNetworkRegistrationInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } @@ -459,39 +468,44 @@ QStringList QOfonoNetworkOperatorInterface::getTechnologies() return qdbus_cast<QStringList>(var); } -void QOfonoNetworkOperatorInterface::connectNotify(const char *signal) +void QOfonoNetworkOperatorInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_NETWORK_OPERATOR_INTERFACE), - QLatin1String("PropertyChanged"), - this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { - qWarning() << "PropertyCHanged not connected"; - } - } + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoNetworkOperatorInterface::propertyChanged); +// if (signal == propertyChangedSignal) { +// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_NETWORK_OPERATOR_INTERFACE), +// QLatin1String("PropertyChanged"), +// this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { +// qWarning() << "PropertyCHanged not connected"; +// } +// } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { - QOfonoDBusHelper *helper; - helper = new QOfonoDBusHelper(this); +// static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoNetworkOperatorInterface::propertyChangedContext); +// if (signal == propertyChangedContextSignal) { +// QOfonoDBusHelper *helper; +// helper = new QOfonoDBusHelper(this); - QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_NETWORK_OPERATOR_INTERFACE), - QLatin1String("PropertyChanged"), - helper,SLOT(propertyChanged(QString,QDBusVariant))); +// QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_NETWORK_OPERATOR_INTERFACE), +// QLatin1String("PropertyChanged"), +// 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 &)), Qt::UniqueConnection); - } +// QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), +// this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection); +// } } -void QOfonoNetworkOperatorInterface::disconnectNotify(const char *signal) +void QOfonoNetworkOperatorInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoNetworkOperatorInterface::propertyChanged); +// if (signal == propertyChangedSignal) { - } +// } } QVariant QOfonoNetworkOperatorInterface::getProperty(const QString &property) @@ -562,39 +576,44 @@ QString QOfonoSimInterface::cardIdentifier() return qdbus_cast<QString>(var); } -void QOfonoSimInterface::connectNotify(const char *signal) +void QOfonoSimInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_SIM_MANAGER_INTERFACE), - QLatin1String("PropertyChanged"), - this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { - qWarning() << "PropertyCHanged not connected"; - } - } + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoSimInterface::propertyChanged); +// if (signal == propertyChangedSignal) { +// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_SIM_MANAGER_INTERFACE), +// QLatin1String("PropertyChanged"), +// this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { +// qWarning() << "PropertyCHanged not connected"; +// } +// } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { - QOfonoDBusHelper *helper; - helper = new QOfonoDBusHelper(this); +// static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoSimInterface::propertyChangedContext); +// if (signal == propertyChangedContextSignal) { +// QOfonoDBusHelper *helper; +// helper = new QOfonoDBusHelper(this); - QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_SIM_MANAGER_INTERFACE), - QLatin1String("PropertyChanged"), - helper,SLOT(propertyChanged(QString,QDBusVariant))); +// QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_SIM_MANAGER_INTERFACE), +// QLatin1String("PropertyChanged"), +// 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 &)), Qt::UniqueConnection); - } +// QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), +// this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection); +// } } -void QOfonoSimInterface::disconnectNotify(const char *signal) +void QOfonoSimInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoSimInterface::propertyChanged); +// if (signal == propertyChangedSignal) { - } +// } } QVariant QOfonoSimInterface::getProperty(const QString &property) @@ -651,39 +670,44 @@ bool QOfonoDataConnectionManagerInterface::isPowered() return qdbus_cast<bool>(var); } -void QOfonoDataConnectionManagerInterface::connectNotify(const char *signal) +void QOfonoDataConnectionManagerInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_DATA_CONNECTION_MANAGER_INTERFACE), - QLatin1String("PropertyChanged"), - this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { - qWarning() << "PropertyCHanged not connected"; - } - } + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoDataConnectionManagerInterface::propertyChanged); +// if (signal == propertyChangedSignal) { +// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_DATA_CONNECTION_MANAGER_INTERFACE), +// QLatin1String("PropertyChanged"), +// this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { +// qWarning() << "PropertyCHanged not connected"; +// } +// } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { - QOfonoDBusHelper *helper; - helper = new QOfonoDBusHelper(this); +// static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoDataConnectionManagerInterface::propertyChangedContext); +// if (signal == propertyChangedContextSignal) { +// QOfonoDBusHelper *helper; +// helper = new QOfonoDBusHelper(this); - QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_DATA_CONNECTION_MANAGER_INTERFACE), - QLatin1String("PropertyChanged"), - helper,SLOT(propertyChanged(QString,QDBusVariant))); +// QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_DATA_CONNECTION_MANAGER_INTERFACE), +// QLatin1String("PropertyChanged"), +// 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 &)), Qt::UniqueConnection); - } +// QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), +// this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection); +// } } -void QOfonoDataConnectionManagerInterface::disconnectNotify(const char *signal) +void QOfonoDataConnectionManagerInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoDataConnectionManagerInterface::propertyChanged); +// if (signal == propertyChangedSignal) { - } +// } } QVariant QOfonoDataConnectionManagerInterface::getProperty(const QString &property) @@ -770,39 +794,44 @@ bool QOfonoPrimaryDataContextInterface::setApn(const QString &name) return setProp("AccessPointName", QVariant::fromValue(name)); } -void QOfonoPrimaryDataContextInterface::connectNotify(const char *signal) +void QOfonoPrimaryDataContextInterface::connectNotify(const QMetaMethod &signal) { -if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_DATA_CONTEXT_INTERFACE), - QLatin1String("PropertyChanged"), - this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { - qWarning() << "PropertyCHanged not connected"; - } - } + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoPrimaryDataContextInterface::propertyChanged); +// if (signal == propertyChangedSignal) { +// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_DATA_CONTEXT_INTERFACE), +// QLatin1String("PropertyChanged"), +// this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { +// qWarning() << "PropertyCHanged not connected"; +// } +// } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { - QOfonoDBusHelper *helper; - helper = new QOfonoDBusHelper(this); +// static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoPrimaryDataContextInterface::propertyChangedContext); +// if (signal == propertyChangedContextSignal) { +// QOfonoDBusHelper *helper; +// helper = new QOfonoDBusHelper(this); - QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), - this->path(), - QLatin1String(OFONO_DATA_CONTEXT_INTERFACE), - QLatin1String("PropertyChanged"), - helper,SLOT(propertyChanged(QString,QDBusVariant))); +// QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), +// this->path(), +// QLatin1String(OFONO_DATA_CONTEXT_INTERFACE), +// QLatin1String("PropertyChanged"), +// 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 &)), Qt::UniqueConnection); - } +// QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), +// this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection); +// } } -void QOfonoPrimaryDataContextInterface::disconnectNotify(const char *signal) +void QOfonoPrimaryDataContextInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + Q_UNUSED(signal); +// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoPrimaryDataContextInterface::propertyChanged); +// if (signal == propertyChangedSignal) { - } +// } } QVariant QOfonoPrimaryDataContextInterface::getProperty(const QString &property) @@ -852,9 +881,10 @@ QOfonoSmsInterface::~QOfonoSmsInterface() { } -void QOfonoSmsInterface::connectNotify(const char *signal) +void QOfonoSmsInterface::connectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::propertyChanged); + if (signal == propertyChangedSignal) { if(!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_SMS_MANAGER_INTERFACE), @@ -864,7 +894,8 @@ void QOfonoSmsInterface::connectNotify(const char *signal) } } - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { + static const QMetaMethod propertyChangedContextSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::propertyChangedContext); + if (signal == propertyChangedContextSignal) { QOfonoDBusHelper *helper; helper = new QOfonoDBusHelper(this); @@ -879,7 +910,8 @@ void QOfonoSmsInterface::connectNotify(const char *signal) this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &))); } - if (QLatin1String(signal) == SIGNAL(immediateMessage(QString,QVariantMap))) { + static const QMetaMethod immediateMessageSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::immediateMessage); + if (signal == immediateMessageSignal) { if(!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_SMS_MANAGER_INTERFACE), @@ -889,7 +921,8 @@ void QOfonoSmsInterface::connectNotify(const char *signal) } } - if (QLatin1String(signal) == SIGNAL(incomingMessage(QString,QVariantMap))) { + static const QMetaMethod incomingMessageSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::incomingMessage); + if (signal == incomingMessageSignal) { if(!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_SMS_MANAGER_INTERFACE), @@ -900,9 +933,10 @@ void QOfonoSmsInterface::connectNotify(const char *signal) } } -void QOfonoSmsInterface::disconnectNotify(const char *signal) +void QOfonoSmsInterface::disconnectNotify(const QMetaMethod &signal) { - if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) { + static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::propertyChanged); + if (signal == propertyChangedSignal) { } } diff --git a/src/plugins/bearer/connman/qofonoservice_linux_p.h b/src/plugins/bearer/connman/qofonoservice_linux_p.h index c92804dd3a..141f709d3d 100644 --- a/src/plugins/bearer/connman/qofonoservice_linux_p.h +++ b/src/plugins/bearer/connman/qofonoservice_linux_p.h @@ -111,8 +111,8 @@ Q_SIGNALS: void propertyChanged(const QString &, const QDBusVariant &value); void propertyChangedContext(const QString &,const QString &,const QDBusVariant &); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -155,8 +155,8 @@ public: QString defaultInterface(); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); Q_SIGNALS: void propertyChanged(const QString &, const QDBusVariant &value); @@ -186,8 +186,8 @@ public: QList <QDBusObjectPath> getOperators(); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); Q_SIGNALS: void propertyChanged(const QString &, const QDBusVariant &value); @@ -214,8 +214,8 @@ public: QStringList getTechnologies(); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -241,8 +241,8 @@ public: QString cardIdentifier(); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -267,8 +267,8 @@ public: bool setPower(bool on); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); }; @@ -297,8 +297,8 @@ public: bool setApn(const QString &name); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); bool setProp(const QString &, const QVariant &var); }; @@ -321,8 +321,8 @@ public: QString bearer(); protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); + void connectNotify(const QMetaMethod &signal); + void disconnectNotify(const QMetaMethod &signal); QVariant getProperty(const QString &); Q_SIGNALS: |