diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp index 4cb634c..7826f24 100644 --- a/connd/qconnectionagent.cpp +++ b/connd/qconnectionagent.cpp @@ -58,7 +58,6 @@ QConnectionAgent::QConnectionAgent(QObject *parent) : ua(0), netman(NetworkManagerFactory::createInstance()), currentNetworkState(QString()), - askForRoaming(false), isEthernet(false), connmanAvailable(false), oContext(0), @@ -84,7 +83,6 @@ QConnectionAgent::QConnectionAgent(QObject *parent) : } connect(this,SIGNAL(configurationNeeded(QString)),this,SLOT(openConnectionDialog(QString))); - askForRoaming = askRoaming(); connect(netman,SIGNAL(servicesListChanged(QStringList)),this,SLOT(servicesListChanged(QStringList))); connect(netman,SIGNAL(stateChanged(QString)),this,SLOT(networkStateChanged(QString))); @@ -422,25 +420,6 @@ void QConnectionAgent::networkStateChanged(const QString &state) } } -bool QConnectionAgent::askRoaming() const -{ - qDebug() << Q_FUNC_INFO; - bool roaming; - QSettings confFile; - confFile.beginGroup("Connectionagent"); - roaming = confFile.value("askForRoaming").toBool(); - return roaming; -} - -void QConnectionAgent::setAskRoaming(bool value) -{ - qDebug() << Q_FUNC_INFO; - QSettings confFile; - confFile.beginGroup("Connectionagent"); - confFile.setValue("askForRoaming",value); - askForRoaming = value; -} - void QConnectionAgent::connmanAvailabilityChanged(bool b) { qDebug() << Q_FUNC_INFO; @@ -660,10 +639,6 @@ void QConnectionAgent::serviceAutoconnectChanged(bool on) mobileConnected = true; } } - if (!mobileConnected && service->roaming() && askRoaming() && !flightModeSuppression) { - Q_EMIT connectionRequest(); - return; - } } if ((service->type() == "wifi" && mobileConnected) @@ -747,38 +722,31 @@ QString QConnectionAgent::findBestConnectableService() if (netman->defaultRoute()->type() == "wifi" && service->type() != "wifi") return QString(); // prefer connected wifi - bool isCellRoaming = false; - if (service->type() == "cellular" && service->roaming() && !service->connected()) { - - isCellRoaming = askForRoaming; - - QOfonoManager oManager; - if (!oManager.available()) { - qDebug() << "ofono not available."; - } - if (oManager.modems().count() < 1) - return QString(); - - QOfonoConnectionManager oConnManager; - oConnManager.setModemPath(oManager.modems().at(0)); - - if (oConnManager.roamingAllowed()) { - if (askRoaming()) { - // ask user - if (!flightModeSuppression) { - Q_EMIT connectionRequest(); - } - return QString(); - } - } - //roaming and user doesnt want connection while roaming - qDebug() << "roaming not allowed"; - return QString(); - } +// if (service->type() == "cellular" && service->roaming() && !service->connected()) { +// QOfonoManager oManager; +// if (!oManager.available()) { +// qDebug() << "ofono not available."; +// } +// if (oManager.modems().count() < 1) +// return QString(); +// QOfonoConnectionManager oConnManager; +// oConnManager.setModemPath(oManager.modems().at(0)); +// if (oConnManager.roamingAllowed()) { +// if (askRoaming()) { +// // ask user +// if (!flightModeSuppression) { +// Q_EMIT connectionRequest(); +// } +// return QString(); +// } +// } +// //roaming and user doesnt want connection while roaming +// qDebug() << "roaming not allowed"; +// return QString(); +// } if (isBestService(service) - && service->favorite() - && !isCellRoaming) { + && service->favorite()) { qDebug() << path; return path; } diff --git a/connd/qconnectionagent.h b/connd/qconnectionagent.h index 5d1a22e..f34beb5 100644 --- a/connd/qconnectionagent.h +++ b/connd/qconnectionagent.h @@ -41,14 +41,11 @@ class QTimer; class QConnectionAgent : public QObject { Q_OBJECT - Q_PROPERTY(bool askRoaming READ askRoaming WRITE setAskRoaming) public: ~QConnectionAgent(); static QConnectionAgent &instance(); - bool askRoaming() const; - void setAskRoaming(bool value); Q_SIGNALS: @@ -94,7 +91,6 @@ public Q_SLOTS: QStringList orderedServicesList; QStringList techPreferenceList; - bool askForRoaming; bool isEthernet; bool connmanAvailable; diff --git a/connectionagentplugin/connectionagentplugin.cpp b/connectionagentplugin/connectionagentplugin.cpp index 441fcac..caa5b05 100644 --- a/connectionagentplugin/connectionagentplugin.cpp +++ b/connectionagentplugin/connectionagentplugin.cpp @@ -172,16 +172,6 @@ void ConnectionAgentPlugin::onConnectionState(const QString &state, const QStrin Q_EMIT connectionState(state, type); } -bool ConnectionAgentPlugin::askRoaming() const -{ - return connManagerInterface->askRoaming(); -} - -void ConnectionAgentPlugin::setAskRoaming(bool value) -{ - connManagerInterface->setAskRoaming(value); -} - void ConnectionAgentPlugin::startTethering(const QString &type) { connManagerInterface->startTethering(type); diff --git a/connectionagentplugin/connectionagentplugin.h b/connectionagentplugin/connectionagentplugin.h index b6e2b1b..8e32a0f 100644 --- a/connectionagentplugin/connectionagentplugin.h +++ b/connectionagentplugin/connectionagentplugin.h @@ -24,15 +24,12 @@ class NetworkManager; class ConnectionAgentPlugin : public QObject { Q_OBJECT - Q_PROPERTY(bool askRoaming READ askRoaming WRITE setAskRoaming) Q_DISABLE_COPY(ConnectionAgentPlugin) public: explicit ConnectionAgentPlugin(QObject *parent = 0); ~ConnectionAgentPlugin(); - bool askRoaming() const; - void setAskRoaming(bool value); public slots: void sendUserReply(const QVariantMap &input);