diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp index baffafa..1eab546 100644 --- a/connd/qconnectionagent.cpp +++ b/connd/qconnectionagent.cpp @@ -111,7 +111,6 @@ void QConnectionAgent::onUserInputRequested(const QString &servicePath, const QV // from useragent void QConnectionAgent::onUserInputCanceled() { - qDebug() ; Q_EMIT userInputCanceled(); } @@ -305,11 +304,6 @@ void QConnectionAgent::connectToType(const QString &type) Q_EMIT configurationNeeded(convType); } -void QConnectionAgent::onScanFinished() -{ - qDebug() << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"; -} - void QConnectionAgent::updateServices() { qDebug() << Q_FUNC_INFO; @@ -483,7 +477,6 @@ void QConnectionAgent::techChanged() if (technology->type() == "wifi") { tetheringWifiTech = technology; connect(tetheringWifiTech,SIGNAL(poweredChanged(bool)),this,SLOT(technologyPowerChanged(bool))); - connect(tetheringWifiTech,SIGNAL(scanFinished()),this,SLOT(onScanFinished())); connect(tetheringWifiTech, SIGNAL(tetheringChanged(bool)), this,SLOT(techTetheringChanged(bool)), Qt::UniqueConnection); } @@ -560,22 +553,6 @@ void QConnectionAgent::serviceAutoconnectChanged(bool on) } } -bool QConnectionAgent::isBestService(NetworkService *service) -{ - - qDebug() << Q_FUNC_INFO - << service->path() - << tetheringEnabled - << netman->defaultRoute()->path().contains(service->path()) - << (netman->defaultRoute()->state() != "online"); - - if (tetheringEnabled) return false; - if (netman->offlineMode() && service->type() == "cellular") return false; - if (netman->defaultRoute()->type() == "wifi" && service->type() == "cellular") return false; - if (netman->defaultRoute()->path().contains(service->path())) return false; - return true; -} - void QConnectionAgent::scanTimeout() { if (!tetheringWifiTech || tetheringWifiTech->tethering()) @@ -598,49 +575,6 @@ void QConnectionAgent::servicesChanged() updateServices(); } -QString QConnectionAgent::findBestConnectableService() -{ - for (int i = 0; i < orderedServicesList.count(); i++) { - - QString path = orderedServicesList.at(i).path; - - NetworkService *service = orderedServicesList.at(i).service; - if (!service) - continue; - - qDebug() << "looking at" - << service->name() - << service->autoConnect(); - - bool online = isStateOnline(netman->defaultRoute()->state()); - qDebug() << "state is"<< online << netman->defaultRoute()->path(); - - if (!service->autoConnect()) { - continue; - } - - qDebug() <defaultRoute()->path() == service->path()) - << netman->defaultRoute()->strength() - << service->strength(); - - if ((netman->defaultRoute()->type() == "wifi" && service->type() == "wifi") - && netman->defaultRoute()->strength() > service->strength()) - return QString(); //better quality already connected - - if (netman->defaultRoute()->type() == "wifi" && service->type() != "wifi") - return QString(); // prefer connected wifi - - if (isBestService(service) - && service->favorite()) { - qDebug() << path; - return path; - } - } - return QString(); -} - void QConnectionAgent::removeAllTypes(const QString &type) { Q_FOREACH (Service elem, orderedServicesList) { diff --git a/connd/qconnectionagent.h b/connd/qconnectionagent.h index c9cda8d..33e131b 100644 --- a/connd/qconnectionagent.h +++ b/connd/qconnectionagent.h @@ -106,8 +106,6 @@ public Q_SLOTS: void setup(); void updateServices(); bool isStateOnline(const QString &state); - bool isBestService(NetworkService *service); - QString findBestConnectableService(); void removeAllTypes(const QString &type); bool shouldSuppressError(const QString &error, bool cellular) const; @@ -131,8 +129,6 @@ public Q_SLOTS: bool valid; private slots: - void onScanFinished(); - void serviceErrorChanged(const QString &error); void serviceStateChanged(const QString &state); void networkStateChanged(const QString &state);