Skip to content

Commit

Permalink
[connectionagent] Removed (some) unnecessary stuff
Browse files Browse the repository at this point in the history
The background wifi scan is taken care of by connman, there is no need
to mess with that.
  • Loading branch information
monich committed Jun 12, 2017
1 parent 3ba10b0 commit 2572568
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 166 deletions.
6 changes: 2 additions & 4 deletions connd/connd.pro
Expand Up @@ -23,12 +23,10 @@ connadaptor.header_flags = -c ConnAdaptor
connadaptor.source_flags = -c ConnAdaptor

SOURCES += main.cpp \
qconnectionagent.cpp \
wakeupwatcher.cpp
qconnectionagent.cpp

HEADERS += \
qconnectionagent.h \
wakeupwatcher.h
qconnectionagent.h

target.path = /usr/bin
INSTALLS += target
Expand Down
15 changes: 0 additions & 15 deletions connd/qconnectionagent.cpp
Expand Up @@ -16,13 +16,11 @@

#include "qconnectionagent.h"
#include "connectiond_adaptor.h"
#include "wakeupwatcher.h"

#include <connman-qt5/useragent.h>
#include <connman-qt5/networkmanager.h>
#include <connman-qt5/networktechnology.h>
#include <connman-qt5/networkservice.h>
#include <connman-qt5/sessionagent.h>

#include <QtDBus/QDBusConnection>

Expand Down Expand Up @@ -85,9 +83,6 @@ QConnectionAgent::QConnectionAgent(QObject *parent) :
//ethernet,bluetooth,cellular,wifi is default
techPreferenceList << "bluetooth" << "wifi" << "cellular" << "ethernet";

mceWatch = new WakeupWatcher(this);
connect(mceWatch,SIGNAL(displayStateChanged(QString)),this,SLOT(displayStateChanged(QString)));

connmanAvailable = QDBusConnection::systemBus().interface()->isServiceRegistered("net.connman");

scanTimer = new QTimer(this);
Expand Down Expand Up @@ -561,16 +556,6 @@ void QConnectionAgent::flightModeDialogSuppressionTimeout()
flightModeSuppression = false;
}

void QConnectionAgent::displayStateChanged(const QString &state)
{
if (state == "on") {
NetworkTechnology *wifiTech = netman->getTechnology("wifi");
if (wifiTech && wifiTech->powered() && !wifiTech->connected() && !wifiTech->tethering()) {
wifiTech->scan();
}
}
}

void QConnectionAgent::serviceAutoconnectChanged(bool on)
{
NetworkService *service = qobject_cast<NetworkService *>(sender());
Expand Down
17 changes: 0 additions & 17 deletions connd/qconnectionagent.h
Expand Up @@ -17,23 +17,14 @@
#define QCONNECTIONAGENT_H

#include <QObject>
#include <QMap>
#include <QStringList>
#include <QVariant>
#include <QDBusMessage>
#include <QDBusObjectPath>
#include <QQueue>
#include <QPair>
#include <QElapsedTimer>
#include <QVector>

class UserAgent;
class SessionAgent;

class NetworkManager;
class NetworkService;
class NetworkTechnology;
class WakeupWatcher;
class QTimer;

class QConnectionAgent : public QObject
Expand Down Expand Up @@ -120,22 +111,16 @@ public Q_SLOTS:
void removeAllTypes(const QString &type);

UserAgent *ua;

NetworkManager *netman;
SessionAgent *sessionAgent;

QString currentNetworkState;

ServiceList orderedServicesList;

QStringList techPreferenceList;
bool isEthernet;
bool connmanAvailable;

NetworkTechnology *tetheringWifiTech;
bool tetheringEnabled;
bool flightModeSuppression;
WakeupWatcher *mceWatch;
uint scanTimeoutInterval;

QTimer *scanTimer;
Expand All @@ -160,8 +145,6 @@ private slots:
void offlineModeChanged(bool);
void flightModeDialogSuppressionTimeout();

void displayStateChanged(const QString &);

void serviceAutoconnectChanged(bool);
void scanTimeout();
void techTetheringChanged(bool b);
Expand Down
83 changes: 0 additions & 83 deletions connd/wakeupwatcher.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions connd/wakeupwatcher.h

This file was deleted.

6 changes: 2 additions & 4 deletions test/auto/tst_connectionagent/tst_connectionagent.pro
Expand Up @@ -11,12 +11,10 @@ DEFINES += SRCDIR=\\\"$$PWD/\\\"

SOURCES += tst_connectionagent.cpp \
../../../connd/qconnectionagent.cpp \
../../../connd/connectiond_adaptor.cpp \
../../../connd/wakeupwatcher.cpp
../../../connd/connectiond_adaptor.cpp
HEADERS += \
../../../connd/qconnectionagent.h \
../../../connd/connectiond_adaptor.h \
../../../connd/wakeupwatcher.h
../../../connd/connectiond_adaptor.h

INCLUDEPATH += $$OUT_PWD/../../../connd

Expand Down

0 comments on commit 2572568

Please sign in to comment.