From 9b67d89c24666d405dd00e63bb56c924738aa002 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 23 Jan 2015 13:05:12 +0400 Subject: Pass params of shareable type by const-ref rather than by value ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge Reviewed-by: Thiago Macieira --- src/corelib/io/qfilesystemwatcher_fsevents.mm | 12 ++++++------ src/corelib/io/qfilesystemwatcher_fsevents_p.h | 8 ++++---- src/corelib/io/qsettings_winrt.cpp | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm index 1dc45a7e41..1076b8f5b4 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.mm +++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm @@ -283,13 +283,13 @@ void QFseventsFileSystemWatcherEngine::processEvent(ConstFSEventStreamRef stream #endif } -void QFseventsFileSystemWatcherEngine::doEmitFileChanged(const QString path, bool removed) +void QFseventsFileSystemWatcherEngine::doEmitFileChanged(const QString &path, bool removed) { DEBUG() << "emitting fileChanged for" << path << "with removed =" << removed; emit fileChanged(path, removed); } -void QFseventsFileSystemWatcherEngine::doEmitDirectoryChanged(const QString path, bool removed) +void QFseventsFileSystemWatcherEngine::doEmitDirectoryChanged(const QString &path, bool removed) { DEBUG() << "emitting directoryChanged for" << path << "with removed =" << removed; emit directoryChanged(path, removed); @@ -316,10 +316,10 @@ QFseventsFileSystemWatcherEngine::QFseventsFileSystemWatcherEngine(QObject *pare // We cannot use signal-to-signal queued connections, because the // QSignalSpy cannot spot signals fired from other/alien threads. - connect(this, SIGNAL(emitDirectoryChanged(const QString, bool)), - this, SLOT(doEmitDirectoryChanged(const QString, bool)), Qt::QueuedConnection); - connect(this, SIGNAL(emitFileChanged(const QString, bool)), - this, SLOT(doEmitFileChanged(const QString, bool)), Qt::QueuedConnection); + connect(this, SIGNAL(emitDirectoryChanged(QString,bool)), + this, SLOT(doEmitDirectoryChanged(QString,bool)), Qt::QueuedConnection); + connect(this, SIGNAL(emitFileChanged(QString,bool)), + this, SLOT(doEmitFileChanged(QString,bool)), Qt::QueuedConnection); connect(this, SIGNAL(scheduleStreamRestart()), this, SLOT(restartStream()), Qt::QueuedConnection); diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h index bd75a0aa32..b4640afc4e 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h +++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h @@ -74,13 +74,13 @@ public: void processEvent(ConstFSEventStreamRef streamRef, size_t numEvents, char **eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]); Q_SIGNALS: - void emitFileChanged(const QString path, bool removed); - void emitDirectoryChanged(const QString path, bool removed); + void emitFileChanged(const QString &path, bool removed); + void emitDirectoryChanged(const QString &path, bool removed); void scheduleStreamRestart(); private slots: - void doEmitFileChanged(const QString path, bool removed); - void doEmitDirectoryChanged(const QString path, bool removed); + void doEmitFileChanged(const QString &path, bool removed); + void doEmitDirectoryChanged(const QString &path, bool removed); void restartStream(); private: diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp index 8f9d6d3692..bf8b157d00 100644 --- a/src/corelib/io/qsettings_winrt.cpp +++ b/src/corelib/io/qsettings_winrt.cpp @@ -281,7 +281,7 @@ class QWinRTSettingsPrivate : public QSettingsPrivate public: QWinRTSettingsPrivate(QSettings::Scope scope, const QString &organization, const QString &application); - QWinRTSettingsPrivate(QString rKey); + QWinRTSettingsPrivate(const QString &rKey); ~QWinRTSettingsPrivate(); void remove(const QString &uKey); @@ -315,7 +315,7 @@ QWinRTSettingsPrivate::QWinRTSettingsPrivate(QSettings::Scope scope, const QStri init(scope); } -QWinRTSettingsPrivate::QWinRTSettingsPrivate(QString rPath) +QWinRTSettingsPrivate::QWinRTSettingsPrivate(const QString &rPath) : QSettingsPrivate(QSettings::NativeFormat, QSettings::UserScope, rPath, QString()) , writeContainer(0) { -- cgit v1.2.3