Skip to content

Commit

Permalink
[connectionagent] send errorReported paths on to declarative.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorn Potter committed Jun 7, 2013
1 parent 7eee72b commit 2929dc9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions connd/qconnectionmanager.cpp
Expand Up @@ -152,10 +152,9 @@ void QConnectionManager::onUserInputCanceled()
// from useragent
void QConnectionManager::onErrorReported(const QString &servicePath, const QString &error)
{
Q_UNUSED(servicePath)
qDebug() << Q_FUNC_INFO;

Q_EMIT errorReported(error);
Q_EMIT errorReported(servicePath, error);
}

// from useragent
Expand Down Expand Up @@ -212,7 +211,8 @@ void QConnectionManager::onServiceRemoved(const QString &/*servicePath*/)

void QConnectionManager::serviceErrorChanged(const QString &error)
{
Q_EMIT errorReported(error);
NetworkService *service = qobject_cast<NetworkService *>(sender());
Q_EMIT errorReported(service->path(),error);
}

void QConnectionManager::serviceStateChanged(const QString &state)
Expand All @@ -228,7 +228,7 @@ void QConnectionManager::serviceStateChanged(const QString &state)
service->requestDisconnect();
service->remove(); //reset this service
okToConnect = true;
Q_EMIT errorReported("Connection failure: "+ service->name());
Q_EMIT errorReported(service->path(), "Connection failure: "+ service->name());
}

//auto migrate
Expand Down Expand Up @@ -328,7 +328,7 @@ void QConnectionManager::connectToType(const QString &type)
qDebug() << Q_FUNC_INFO << techPath;

if (techPath.isEmpty()) {
Q_EMIT errorReported("Type not valid");
Q_EMIT errorReported("","Type not valid");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion connd/qconnectionmanager.h
Expand Up @@ -51,7 +51,7 @@ class QConnectionManager : public QObject

void userInputRequested(const QString &servicePath, const QVariantMap &fields);
void userInputCanceled();
void errorReported(const QString &error);
void errorReported(const QString &servicePath, const QString &error);
void connectionRequest();
void configurationNeeded(const QString &type);
void connectionState(const QString &state, const QString &type);
Expand Down
12 changes: 6 additions & 6 deletions connectionagentplugin/connectionagentplugin.cpp
Expand Up @@ -98,21 +98,21 @@ void ConnectionAgentPlugin::connectToConnectiond(QString)
void ConnectionAgentPlugin::sendUserReply(const QVariantMap &input)
{
if (!connManagerInterface || !connManagerInterface->isValid()) {
Q_EMIT errorReported("ConnectionAgent not available");
Q_EMIT errorReported("","ConnectionAgent not available");
return;
}
QDBusPendingReply<> reply = connManagerInterface->sendUserReply(input);
reply.waitForFinished();
if (reply.isError()) {
qDebug() << Q_FUNC_INFO << reply.error().message();
Q_EMIT errorReported(reply.error().message());
Q_EMIT errorReported("",reply.error().message());
}
}

void ConnectionAgentPlugin::sendConnectReply(const QString &replyMessage, int timeout)
{
if (!connManagerInterface || !connManagerInterface->isValid()) {
Q_EMIT errorReported("ConnectionAgent not available");
Q_EMIT errorReported("","ConnectionAgent not available");
return;
}
connManagerInterface->sendConnectReply(replyMessage,timeout);
Expand All @@ -121,16 +121,16 @@ void ConnectionAgentPlugin::sendConnectReply(const QString &replyMessage, int ti
void ConnectionAgentPlugin::connectToType(const QString &type)
{
if (!connManagerInterface || !connManagerInterface->isValid()) {
Q_EMIT errorReported("ConnectionAgent not available");
Q_EMIT errorReported("","ConnectionAgent not available");
return;
}

connManagerInterface->connectToType(type);
}

void ConnectionAgentPlugin::onErrorReported(const QString &error)
void ConnectionAgentPlugin::onErrorReported(const QString &servicePath, const QString &error)
{
Q_EMIT errorReported(error);
Q_EMIT errorReported(servicePath, error);
}

void ConnectionAgentPlugin::onRequestBrowser(const QString &url)
Expand Down
4 changes: 2 additions & 2 deletions connectionagentplugin/connectionagentplugin.h
Expand Up @@ -42,7 +42,7 @@ public slots:
signals:
void userInputRequested(const QString &servicePath, const QVariantMap &fields);
void userInputCanceled();
void errorReported(const QString &error);
void errorReported(const QString &servicePath, const QString &error);
void connectionRequest();
void configurationNeeded(const QString &type);
void connectionState(const QString &state, const QString &type);
Expand All @@ -52,7 +52,7 @@ public slots:
QDBusServiceWatcher *connectiondWatcher;

private slots:
void onErrorReported(const QString &error);
void onErrorReported(const QString &servicePath, const QString &error);
void onRequestBrowser(const QString &url);
void onUserInputRequested(const QString &service, const QVariantMap &fields);
void onConnectionRequested();
Expand Down

0 comments on commit 2929dc9

Please sign in to comment.