diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-17 20:02:14 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-19 19:46:54 +0100 |
commit | 4e1bebf0f5e06ecdd99c41771e7b4ee19c0cdcf3 (patch) | |
tree | d0e98cee9eef416282049092ea93b0b2b6eb417d /src/recording | |
parent | 133ea1e3d6547964f014144eee15590ea449c7af (diff) |
Pass non-trivial/large function args by reference
Fixes a bunch of `-Wclazy-function-args-by-ref` warnings. See
https://github.com/KDE/clazy/blob/master/docs/checks/README-function-args-by-ref.md
for details.
Most of these changes are automated, using the clazy fixit by setting
the `CLAZY_EXPORT_FIXES` before compilation and then running:
$ mkdir /tmp/patch
$ find ../src -iname "*.yaml" -exec mv {} /tmp/patch \;
$ clang-apply-replacements /tmp/patch
Diffstat (limited to 'src/recording')
-rw-r--r-- | src/recording/recordingmanager.cpp | 2 | ||||
-rw-r--r-- | src/recording/recordingmanager.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/recording/recordingmanager.cpp b/src/recording/recordingmanager.cpp index 54d635de11..63dab0851a 100644 --- a/src/recording/recordingmanager.cpp +++ b/src/recording/recordingmanager.cpp @@ -74,7 +74,7 @@ RecordingManager::~RecordingManager() { delete m_pToggleRecording; } -QString RecordingManager::formatDateTimeForFilename(QDateTime dateTime) const { +QString RecordingManager::formatDateTimeForFilename(const QDateTime& dateTime) const { // Use a format based on ISO 8601. Windows does not support colons in // filenames so we can't use them anywhere. QString formatted = dateTime.toString("yyyy-MM-dd_hh'h'mm'm'ss's'"); diff --git a/src/recording/recordingmanager.h b/src/recording/recordingmanager.h index f458c14cd1..526963f6cb 100644 --- a/src/recording/recordingmanager.h +++ b/src/recording/recordingmanager.h @@ -48,7 +48,7 @@ class RecordingManager : public QObject // Emits the cumulative number of bytes currently recorded. void bytesRecorded(int); void isRecording(bool); - void durationRecorded(QString); + void durationRecorded(const QString&); public slots: void slotIsRecording(bool recording, bool error); @@ -58,7 +58,7 @@ class RecordingManager : public QObject void slotToggleRecording(double value); private: - QString formatDateTimeForFilename(QDateTime dateTime) const; + QString formatDateTimeForFilename(const QDateTime& dateTime) const; // slotBytesRecorded just noticed that recording must be interrupted // to split the file. The nth filename will follow the date/time // name of the first split but with a suffix. |