Commit b7bb8d94 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Fixed QStrings not being passed by ref

parent beeae630
......@@ -52,7 +52,7 @@ public:
FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const QUrl &destination);
void start() override;
QUrl destination() const { return mDestination; }
void setOriginName(QString from) { mFrom = from; }
void setOriginName(const QString& from) { mFrom = from; }
private Q_SLOTS:
void doStart();
......
......@@ -156,7 +156,7 @@ QString KdeConnectConfig::name()
return name;
}
void KdeConnectConfig::setName(QString name)
void KdeConnectConfig::setName(const QString& name)
{
d->config->setValue(QStringLiteral("name"), name);
d->config->sync();
......@@ -243,7 +243,7 @@ void KdeConnectConfig::removeTrustedDevice(const QString &deviceId)
}
// Utility functions to set and get a value
void KdeConnectConfig::setDeviceProperty(QString deviceId, QString key, QString value)
void KdeConnectConfig::setDeviceProperty(const QString& deviceId, const QString& key, const QString& value)
{
d->trusted_devices->beginGroup(deviceId);
d->trusted_devices->setValue(key, value);
......@@ -251,7 +251,7 @@ void KdeConnectConfig::setDeviceProperty(QString deviceId, QString key, QString
d->trusted_devices->sync();
}
QString KdeConnectConfig::getDeviceProperty(QString deviceId, QString key, QString defaultValue)
QString KdeConnectConfig::getDeviceProperty(const QString& deviceId, const QString& key, const QString& defaultValue)
{
QString value;
d->trusted_devices->beginGroup(deviceId);
......
......@@ -56,7 +56,7 @@ public:
QString certificatePath();
QSslCertificate certificate();
void setName(QString name);
void setName(const QString& name);
/*
* Trusted devices
......@@ -67,8 +67,8 @@ public:
void addTrustedDevice(const QString &id, const QString &name, const QString &type);
KdeConnectConfig::DeviceInfo getTrustedDevice(const QString &id);
void setDeviceProperty(QString deviceId, QString name, QString value);
QString getDeviceProperty(QString deviceId, QString name, QString defaultValue = QString());
void setDeviceProperty(const QString& deviceId, const QString& name, const QString& value);
QString getDeviceProperty(const QString& deviceId, const QString& name, const QString& defaultValue = QString());
/*
* Paths for config files, there is no guarantee the directories already exist
......
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