From 1c47b15d1806e9b4ff4d4d6d7d9f6a86d06645fe Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 19 May 2014 18:34:53 +0300 Subject: [PATCH] ProjectExplorer: Pass some values by reference Change-Id: I628c317fc86f1f4b33ca453018d54fb86babc1e8 Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/compileoutputwindow.cpp | 2 +- .../projectexplorer/devicesupport/devicemanagermodel.cpp | 2 +- .../projectexplorer/devicesupport/devicemanagermodel.h | 2 +- src/plugins/projectexplorer/outputparser_test.cpp | 4 ++-- src/plugins/projectexplorer/outputparser_test.h | 4 ++-- src/plugins/projectexplorer/selectablefilesmodel.cpp | 6 ++++-- src/plugins/projectexplorer/selectablefilesmodel.h | 4 ++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index f1eb3f43623..c6468f39b18 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -176,7 +176,7 @@ QList CompileOutputWindow::toolBarWidgets() const return QList() << m_cancelBuildButton; } -static QColor mix_colors(QColor a, QColor b) +static QColor mix_colors(const QColor &a, const QColor &b) { return QColor((a.red() + 2 * b.red()) / 3, (a.green() + 2 * b.green()) / 3, (a.blue() + 2* b.blue()) / 3, (a.alpha() + 2 * b.alpha()) / 3); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp index ca58a654824..384a81fecfa 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp @@ -62,7 +62,7 @@ DeviceManagerModel::~DeviceManagerModel() delete d; } -void DeviceManagerModel::setFilter(const QList filter) +void DeviceManagerModel::setFilter(const QList &filter) { d->filter = filter; handleDeviceListChanged(); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h index 20c91df404a..6ccf269ded5 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h @@ -46,7 +46,7 @@ public: explicit DeviceManagerModel(const DeviceManager *deviceManager, QObject *parent = 0); ~DeviceManagerModel(); - void setFilter(const QList filter); + void setFilter(const QList &filter); void setTypeFilter(const Core::Id &type); IDevice::ConstPtr device(int pos) const; diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index c73abb6a3ad..4f823521d84 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -89,8 +89,8 @@ void OutputParserTester::testParsing(const QString &lines, } } -void OutputParserTester::testTaskMangling(const Task input, - const Task output) +void OutputParserTester::testTaskMangling(const Task &input, + const Task &output) { reset(); childParser()->taskAdded(input); diff --git a/src/plugins/projectexplorer/outputparser_test.h b/src/plugins/projectexplorer/outputparser_test.h index ad234e24535..c8ad766bb7f 100644 --- a/src/plugins/projectexplorer/outputparser_test.h +++ b/src/plugins/projectexplorer/outputparser_test.h @@ -60,8 +60,8 @@ public: const QString &childStdOutLines, const QString &childStdErrLines, const QString &outputLines); - void testTaskMangling(const Task input, - const Task output); + void testTaskMangling(const Task &input, + const Task &output); void testOutputMangling(const QString &input, const QString &output); diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index 862f95202f7..3c096164920 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -529,7 +529,9 @@ Qt::CheckState SelectableFilesModel::applyFilter(const QModelIndex &index) // SelectableFilesDialogs ////////// -SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const QString &path, const QStringList files, QWidget *parent) +SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const QString &path, + const QStringList &files, + QWidget *parent) : QDialog(parent) { QVBoxLayout *layout = new QVBoxLayout(); @@ -683,7 +685,7 @@ void SelectableFilesDialogEditFiles::applyFilter() } SelectableFilesDialogAddDirectory::SelectableFilesDialogAddDirectory(const QString &path, - const QStringList files, QWidget *parent) : + const QStringList &files, QWidget *parent) : SelectableFilesDialogEditFiles(path, files, parent) { setWindowTitle(tr("Add Existing Directory")); diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index 68561d9de9d..cb3f3a5be07 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -150,7 +150,7 @@ class PROJECTEXPLORER_EXPORT SelectableFilesDialogEditFiles : public QDialog Q_OBJECT public: - SelectableFilesDialogEditFiles(const QString &path, const QStringList files, QWidget *parent); + SelectableFilesDialogEditFiles(const QString &path, const QStringList &files, QWidget *parent); ~SelectableFilesDialogEditFiles(); QStringList selectedFiles() const; @@ -185,7 +185,7 @@ class SelectableFilesDialogAddDirectory : public SelectableFilesDialogEditFiles Q_OBJECT public: - SelectableFilesDialogAddDirectory(const QString &path, const QStringList files, QWidget *parent); + SelectableFilesDialogAddDirectory(const QString &path, const QStringList &files, QWidget *parent); private slots: void validityOfDirectoryChanged(bool validState);