summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-02-17 15:55:50 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-03-05 18:04:57 +0200
commite5dcd9fc161891a4e70364e1dcdf232590eb49c6 (patch)
treeb30bc28a7ff9c2a62cf586e54b047e91afdeec79 /core/qthelper.cpp
parentf5eafe2a713998b345027373a26ad73af9e060b5 (diff)
downloadsubsurface-e5dcd9fc161891a4e70364e1dcdf232590eb49c6.tar.gz
Cleanup: pass QString and QByteArray const-refs to qthelper functions
Passing of QStrings and QByteArrays was inconsistent in qthelper.cpp. Unify to passing const-references. Passing by value is no big deal, since QString and QByteArray do copy-on-write "optimization". Nevertheless, let's keep it as consistent and effective as possible. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index e03f86739..cacee776b 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1127,7 +1127,7 @@ void write_hashes()
}
}
-void add_hash(const QString filename, QByteArray hash)
+void add_hash(const QString &filename, const QByteArray &hash)
{
if (hash.isEmpty())
return;
@@ -1136,7 +1136,7 @@ void add_hash(const QString filename, QByteArray hash)
localFilenameOf[hash] = filename;
}
-QByteArray hashFile(const QString filename)
+QByteArray hashFile(const QString &filename)
{
QCryptographicHash hash(QCryptographicHash::Sha1);
QFile imagefile(filename);
@@ -1164,7 +1164,7 @@ static bool haveHash(const QString &filename)
return hashOf.contains(filename);
}
-QString localFilePath(const QString originalFilename)
+QString localFilePath(const QString &originalFilename)
{
QMutexLocker locker(&hashOfMutex);
@@ -1486,7 +1486,7 @@ QByteArray getCurrentAppState()
return currentApplicationState;
}
-void setCurrentAppState(QByteArray state)
+void setCurrentAppState(const QByteArray &state)
{
currentApplicationState = state;
}