Made a QString const refrence.

This commit is contained in:
Albert Vaca 2016-07-07 01:09:07 +02:00
parent 47c78427cb
commit 6248f03256
2 changed files with 4 additions and 6 deletions

View file

@ -142,9 +142,8 @@ void Daemon::forceOnNetworkChange()
}
}
// I hate this, but not able to find an alternative now
Device *Daemon::getDevice(QString deviceId) {
Device*Daemon::getDevice(const QString& deviceId)
{
Q_FOREACH (Device* device, d->mDevices) {
if (device->id() == deviceId) {
return device;

View file

@ -57,6 +57,8 @@ public:
virtual void reportError(const QString &title, const QString &description) = 0;
virtual QNetworkAccessManager* networkAccessManager();
Device* getDevice(const QString& deviceId);
public Q_SLOTS:
Q_SCRIPTABLE void acquireDiscoveryMode(const QString &id);
Q_SCRIPTABLE void releaseDiscoveryMode(const QString &id);
@ -87,9 +89,6 @@ private:
void cleanDevices();
QScopedPointer<struct DaemonPrivate> d;
public:
Device* getDevice(QString deviceId);
};
#endif