Commit 844e6258 authored by Lorn Potter's avatar Lorn Potter

[connectionagent] remove ask for roaming.

parent 4da45f2f
......@@ -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;
}
......
......@@ -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 @@ private:
QStringList orderedServicesList;
QStringList techPreferenceList;
bool askForRoaming;
bool isEthernet;
bool connmanAvailable;
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment