cleanup
make attribute const construct when initializing no need to have all methods as slots
This commit is contained in:
parent
e1be5319f5
commit
774893d3f9
3 changed files with 9 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ protected:
|
|||
QCA::PrivateKey mPrivateKey;
|
||||
|
||||
private:
|
||||
QString mDeviceId;
|
||||
const QString mDeviceId;
|
||||
LinkProvider* mLinkProvider;
|
||||
|
||||
};
|
||||
|
|
|
@ -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<Device*> 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<Device*> 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
|
||||
|
|
Loading…
Reference in a new issue