From 774893d3f9896801059bffed93812f812faf9684 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 8 Sep 2015 09:22:31 +0200 Subject: [PATCH] cleanup make attribute const construct when initializing no need to have all methods as slots --- core/backends/devicelink.cpp | 3 +-- core/backends/devicelink.h | 2 +- core/daemon.h | 14 +++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/backends/devicelink.cpp b/core/backends/devicelink.cpp index e4a13ca1b..08a3f8387 100644 --- a/core/backends/devicelink.cpp +++ b/core/backends/devicelink.cpp @@ -24,13 +24,12 @@ DeviceLink::DeviceLink(const QString& deviceId, LinkProvider* parent) : QObject(parent) + , mPrivateKey(KdeConnectConfig::instance()->privateKey()) , mDeviceId(deviceId) , mLinkProvider(parent) { Q_ASSERT(!deviceId.isEmpty()); setProperty("deviceId", deviceId); - - mPrivateKey = KdeConnectConfig::instance()->privateKey(); } diff --git a/core/backends/devicelink.h b/core/backends/devicelink.h index 0ae6c0090..af17662f0 100644 --- a/core/backends/devicelink.h +++ b/core/backends/devicelink.h @@ -51,7 +51,7 @@ protected: QCA::PrivateKey mPrivateKey; private: - QString mDeviceId; + const QString mDeviceId; LinkProvider* mLinkProvider; }; diff --git a/core/daemon.h b/core/daemon.h index 3f860633e..4ef241581 100644 --- a/core/daemon.h +++ b/core/daemon.h @@ -42,7 +42,6 @@ public: explicit Daemon(QObject *parent, bool testMode = false); ~Daemon(); -public Q_SLOTS: /** * Returns the daemon. * @@ -52,6 +51,13 @@ public Q_SLOTS: //After calling this, signal deviceDiscovered will be triggered for each device Q_SCRIPTABLE void setDiscoveryEnabled(bool b); + QList devicesList() const; + + virtual void requestPairing(Device *d) = 0; + virtual void reportError(const QString &title, const QString &description) = 0; + virtual QNetworkAccessManager* networkAccessManager(); + +public Q_SLOTS: Q_SCRIPTABLE void forceOnNetworkChange(); @@ -62,12 +68,6 @@ public Q_SLOTS: //Returns a list of ids. The respective devices can be manipulated using the dbus path: "/modules/kdeconnect/Devices/"+id Q_SCRIPTABLE QStringList devices(bool onlyReachable = false, bool onlyPaired = false) const; - virtual void requestPairing(Device *d) = 0; - virtual void reportError(const QString &title, const QString &description) = 0; - virtual QNetworkAccessManager* networkAccessManager(); - - QList devicesList() const; - Q_SIGNALS: Q_SCRIPTABLE void deviceAdded(const QString& id); Q_SCRIPTABLE void deviceRemoved(const QString& id); //Note that paired devices will never be removed