Commit 7631bf4a authored by Raine Makelainen's avatar Raine Makelainen

Update QML ConnectionAgent to new signal-slot style

parent 6f8d606b
...@@ -34,10 +34,10 @@ DeclarativeConnectionAgent::DeclarativeConnectionAgent(QObject *parent): ...@@ -34,10 +34,10 @@ DeclarativeConnectionAgent::DeclarativeConnectionAgent(QObject *parent):
QDBusServiceWatcher::WatchForRegistration | QDBusServiceWatcher::WatchForRegistration |
QDBusServiceWatcher::WatchForUnregistration, this); QDBusServiceWatcher::WatchForUnregistration, this);
connect(connectiondWatcher, SIGNAL(serviceRegistered(QString)), connect(connectiondWatcher, &QDBusServiceWatcher::serviceRegistered,
this, SLOT(connectToConnectiond(QString))); this, &DeclarativeConnectionAgent::connectToConnectiond);
connect(connectiondWatcher, SIGNAL(serviceUnregistered(QString)), connect(connectiondWatcher, &QDBusServiceWatcher::serviceUnregistered,
this, SLOT(connectiondUnregistered(QString))); this, &DeclarativeConnectionAgent::connectiondUnregistered);
connectToConnectiond(); connectToConnectiond();
} }
...@@ -46,7 +46,7 @@ DeclarativeConnectionAgent::~DeclarativeConnectionAgent() ...@@ -46,7 +46,7 @@ DeclarativeConnectionAgent::~DeclarativeConnectionAgent()
{ {
} }
void DeclarativeConnectionAgent::connectToConnectiond(QString) void DeclarativeConnectionAgent::connectToConnectiond()
{ {
delete connManagerInterface; delete connManagerInterface;
connManagerInterface = nullptr; connManagerInterface = nullptr;
...@@ -66,28 +66,22 @@ void DeclarativeConnectionAgent::connectToConnectiond(QString) ...@@ -66,28 +66,22 @@ void DeclarativeConnectionAgent::connectToConnectiond(QString)
if (!connManagerInterface->isValid()) { if (!connManagerInterface->isValid()) {
qDebug() << Q_FUNC_INFO << "is not valid interface"; qDebug() << Q_FUNC_INFO << "is not valid interface";
} }
connect(connManagerInterface,SIGNAL(connectionRequest()), connect(connManagerInterface, &com::jolla::Connectiond::connectionRequest,
this, SIGNAL(connectionRequest())); this, &DeclarativeConnectionAgent::connectionRequest);
connect(connManagerInterface,SIGNAL(configurationNeeded(QString)), connect(connManagerInterface, &com::jolla::Connectiond::configurationNeeded,
this,SIGNAL(configurationNeeded(QString))); this, &DeclarativeConnectionAgent::configurationNeeded);
connect(connManagerInterface, &com::jolla::Connectiond::userInputCanceled,
connect(connManagerInterface,SIGNAL(userInputCanceled()), this, &DeclarativeConnectionAgent::userInputCanceled);
this,SIGNAL(userInputCanceled())); connect(connManagerInterface, &com::jolla::Connectiond::errorReported,
this, &DeclarativeConnectionAgent::errorReported);
connect(connManagerInterface, SIGNAL(errorReported(QString, QString)), connect(connManagerInterface, &com::jolla::Connectiond::connectionState,
this, SIGNAL(errorReported(QString, QString))); this, &DeclarativeConnectionAgent::connectionState);
connect(connManagerInterface, &com::jolla::Connectiond::requestBrowser,
connect(connManagerInterface,SIGNAL(connectionState(QString, QString)), this, &DeclarativeConnectionAgent::browserRequested);
this,SIGNAL(connectionState(QString, QString))); connect(connManagerInterface, &com::jolla::Connectiond::userInputRequested,
this, &DeclarativeConnectionAgent::onUserInputRequested, Qt::UniqueConnection);
connect(connManagerInterface, SIGNAL(requestBrowser(QString)), connect(connManagerInterface, &com::jolla::Connectiond::tetheringFinished,
this, SIGNAL(browserRequested(QString))); this, &DeclarativeConnectionAgent::tetheringFinished);
connect(connManagerInterface,SIGNAL(userInputRequested(QString,QVariantMap)),
this,SLOT(onUserInputRequested(QString,QVariantMap)), Qt::UniqueConnection);
connect(connManagerInterface,SIGNAL(tetheringFinished(bool)),
this,SLOT(tetheringFinished(bool)));
} }
void DeclarativeConnectionAgent::sendUserReply(const QVariantMap &input) void DeclarativeConnectionAgent::sendUserReply(const QVariantMap &input)
...@@ -139,7 +133,7 @@ void DeclarativeConnectionAgent::onUserInputRequested(const QString &service, co ...@@ -139,7 +133,7 @@ void DeclarativeConnectionAgent::onUserInputRequested(const QString &service, co
Q_EMIT userInputRequested(service, map); Q_EMIT userInputRequested(service, map);
} }
void DeclarativeConnectionAgent::connectiondUnregistered(QString) void DeclarativeConnectionAgent::connectiondUnregistered()
{ {
delete connManagerInterface; delete connManagerInterface;
connManagerInterface = nullptr; connManagerInterface = nullptr;
......
...@@ -89,8 +89,8 @@ private: ...@@ -89,8 +89,8 @@ private:
private slots: private slots:
void onUserInputRequested(const QString &service, const QVariantMap &fields); void onUserInputRequested(const QString &service, const QVariantMap &fields);
void connectToConnectiond(const QString = QString()); void connectToConnectiond();
void connectiondUnregistered(const QString = QString()); void connectiondUnregistered();
}; };
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment