summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2019-01-11 08:03:54 +0100
committerLaurent Montel <[email protected]>2019-01-11 08:03:54 +0100
commitf3919e5ecf6beea00a5d3fbe0d864f91dfb96549 (patch)
tree22b02c0b2cdd530608327f8c8f571fc333e59b79
parent0f7d0ee37fccf91183a3475121ea3d18d5d428a2 (diff)
Consti'fy
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp2
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitNotifier.h2
-rw-r--r--libdiscover/resources/PackageState.cpp2
-rw-r--r--libdiscover/resources/PackageState.h2
-rw-r--r--libdiscover/utils.h2
5 files changed, 5 insertions, 5 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp b/libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp
index efaf568..a902f9e 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp
@@ -240,7 +240,7 @@ void PackageKitNotifier::refreshDatabase()
}
}
-QProcess* PackageKitNotifier::checkAptVariable(const QString &aptconfig, const QLatin1String& varname, std::function<void(const QStringRef& val)> func)
+QProcess* PackageKitNotifier::checkAptVariable(const QString &aptconfig, const QLatin1String& varname, const std::function<void(const QStringRef& val)> &func)
{
QProcess* process = new QProcess;
process->start(aptconfig, {QStringLiteral("dump")});
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitNotifier.h b/libdiscover/backends/PackageKitBackend/PackageKitNotifier.h
index 9df25d4..0ba9d86 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitNotifier.h
+++ b/libdiscover/backends/PackageKitBackend/PackageKitNotifier.h
@@ -56,7 +56,7 @@ private:
void recheckSystemUpdate();
void checkOfflineUpdates();
void setupGetUpdatesTransaction(PackageKit::Transaction* transaction);
- QProcess* checkAptVariable(const QString &aptconfig, const QLatin1String& varname, std::function<void(const QStringRef& val)> func);
+ QProcess* checkAptVariable(const QString &aptconfig, const QLatin1String& varname, const std::function<void(const QStringRef& val)> &func);
bool m_needsReboot = false;
uint m_securityUpdates;
diff --git a/libdiscover/resources/PackageState.cpp b/libdiscover/resources/PackageState.cpp
index 6f69a7c..784daaf 100644
--- a/libdiscover/resources/PackageState.cpp
+++ b/libdiscover/resources/PackageState.cpp
@@ -21,7 +21,7 @@
#include "PackageState.h"
#include "libdiscover_debug.h"
-PackageState::PackageState(QString name, QString description, bool installed)
+PackageState::PackageState(const QString &name, const QString &description, bool installed)
: PackageState(name, name, description, installed)
{}
diff --git a/libdiscover/resources/PackageState.h b/libdiscover/resources/PackageState.h
index bf62c4c..ff1fe6f 100644
--- a/libdiscover/resources/PackageState.h
+++ b/libdiscover/resources/PackageState.h
@@ -33,7 +33,7 @@ class DISCOVERCOMMON_EXPORT PackageState
{
public:
PackageState(QString packageName, QString name, QString description, bool installed);
- PackageState(QString name, QString description, bool installed);
+ PackageState(const QString &name, const QString &description, bool installed);
PackageState& operator=(const PackageState& other);
QString packageName() const;
diff --git a/libdiscover/utils.h b/libdiscover/utils.h
index 07d3072..f2be0ad 100644
--- a/libdiscover/utils.h
+++ b/libdiscover/utils.h
@@ -28,7 +28,7 @@
class OneTimeAction : public QObject
{
public:
- OneTimeAction(std::function<void()> func, QObject* parent) : QObject(parent), m_function(func) {}
+ OneTimeAction(const std::function<void()> &func, QObject* parent) : QObject(parent), m_function(func) {}
void trigger() {
m_function();