Skip to content

Commit

Permalink
[connectionagent] more static eth connection. Contributes to JB#7023
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorn Potter committed Jun 11, 2013
1 parent 5a1447b commit 52f0632
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions connd/qconnectionmanager.cpp
Expand Up @@ -52,10 +52,14 @@ QConnectionManager::QConnectionManager(QObject *parent) :
currentType(QString()),
serviceConnect(0),
currentNotification(0),
askForRoaming(0)
askForRoaming(0),
isEthernet(0)
{
qDebug() << Q_FUNC_INFO << netman->state();

NetworkService *defaultService = netman->defaultRoute();
if (defaultService->type() == "ethernet")
isEthernet = true;
// let me control autoconnect
netman->setSessionMode(true);

Expand Down Expand Up @@ -108,9 +112,10 @@ QConnectionManager::QConnectionManager(QObject *parent) :

updateServicesMap();

qDebug() << Q_FUNC_INFO << netman->state();
QSettings confFile;
confFile.beginGroup("Connectionagent");
if (confFile.value("connected", true).toBool()
if (confFile.value("connected").toString() == "online"
&& netman->state() != "online") {
autoConnect();
}
Expand Down Expand Up @@ -240,6 +245,9 @@ void QConnectionManager::serviceStateChanged(const QString &state)
//auto migrate
if (state == "idle") {
connectedServices.removeOne(service->path());
if (isEthernet) { //keep this alive
autoConnect();
}
}

if (!(currentNetworkState == "online" && state == "association"))
Expand Down
1 change: 1 addition & 0 deletions connd/qconnectionmanager.h
Expand Up @@ -94,6 +94,7 @@ public Q_SLOTS:
QList <QString> connectedServices;
QStringList techPreferenceList;
bool askForRoaming;
bool isEthernet;

private slots:
void onScanFinished();
Expand Down

0 comments on commit 52f0632

Please sign in to comment.