Skip to content

Commit

Permalink
[connectionagent] listen to autoconnect changed signal, and
Browse files Browse the repository at this point in the history
try to autoconnect right away.
  • Loading branch information
Lorn Potter committed Oct 31, 2013
1 parent 9bf803d commit 7840b21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connd/qconnectionmanager.cpp
Expand Up @@ -453,6 +453,8 @@ void QConnectionManager::updateServicesMap()

void QConnectionManager::servicesError(const QString &errorMessage)
{
if (errorMessage.isEmpty())
return;
NetworkService *serv = static_cast<NetworkService *>(sender());
qDebug() << serv->name() << errorMessage;
Q_EMIT onErrorReported(serv->path(), errorMessage);
Expand Down Expand Up @@ -752,3 +754,11 @@ void QConnectionManager::connectionTimeout()
errorReported(serviceInProgress,"limited connection");
}
}

void QConnectionManager::serviceAutoconnectChanged(bool on)
{
if (on) {
NetworkService *serv = static_cast<NetworkService *>(sender());
autoConnect();
}
}
1 change: 1 addition & 0 deletions connd/qconnectionmanager.h
Expand Up @@ -146,6 +146,7 @@ private slots:
void sleepStateChanged(bool);

void connectionTimeout();
void serviceAutoconnectChanged(bool);

};

Expand Down

0 comments on commit 7840b21

Please sign in to comment.