diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-01 11:08:26 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-07-01 11:52:08 +0200 |
commit | 93304df0381cbeabf4c8435aec0ad55fbc7f8fe7 (patch) | |
tree | 7cbe348b1e3f88041b7e159aa335031e2c41bfc8 /src/plugins/projectexplorer/taskmodel.cpp | |
parent | 139449239c7cd63ab933d13e20b37cd717a45fe7 (diff) |
Always pass Core::Id by value.
Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.
Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/projectexplorer/taskmodel.cpp')
-rw-r--r-- | src/plugins/projectexplorer/taskmodel.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 7d5ed714fa..8ab188b6c8 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -52,22 +52,22 @@ TaskModel::TaskModel(QObject *parent) : m_categories.insert(Core::Id(), CategoryData()); } -int TaskModel::taskCount(const Core::Id &categoryId) +int TaskModel::taskCount(Core::Id categoryId) { return m_categories.value(categoryId).count; } -int TaskModel::errorTaskCount(const Core::Id &categoryId) +int TaskModel::errorTaskCount(Core::Id categoryId) { return m_categories.value(categoryId).errors; } -int TaskModel::warningTaskCount(const Core::Id &categoryId) +int TaskModel::warningTaskCount(Core::Id categoryId) { return m_categories.value(categoryId).warnings; } -int TaskModel::unknownTaskCount(const Core::Id &categoryId) +int TaskModel::unknownTaskCount(Core::Id categoryId) { return m_categories.value(categoryId).count - m_categories.value(categoryId).errors @@ -82,7 +82,7 @@ bool TaskModel::hasFile(const QModelIndex &index) const return !m_tasks.at(row).file.isEmpty(); } -void TaskModel::addCategory(const Core::Id &categoryId, const QString &categoryName) +void TaskModel::addCategory(Core::Id categoryId, const QString &categoryName) { QTC_ASSERT(categoryId.uniqueIdentifier(), return); CategoryData data; @@ -90,7 +90,7 @@ void TaskModel::addCategory(const Core::Id &categoryId, const QString &categoryN m_categories.insert(categoryId, data); } -QList<Task> TaskModel::tasks(const Core::Id &categoryId) const +QList<Task> TaskModel::tasks(Core::Id categoryId) const { if (categoryId.uniqueIdentifier() == 0) return m_tasks; @@ -165,7 +165,7 @@ void TaskModel::updateTaskLineNumber(unsigned int id, int line) } } -void TaskModel::clearTasks(const Core::Id &categoryId) +void TaskModel::clearTasks(Core::Id categoryId) { typedef QHash<Core::Id,CategoryData>::ConstIterator IdCategoryConstIt; @@ -275,7 +275,7 @@ QList<Core::Id> TaskModel::categoryIds() const return categories; } -QString TaskModel::categoryDisplayName(const Core::Id &categoryId) const +QString TaskModel::categoryDisplayName(Core::Id categoryId) const { return m_categories.value(categoryId).displayName; } |