diff options
| author | Orgad Shaneh <[email protected]> | 2018-09-25 21:08:52 +0300 |
|---|---|---|
| committer | Orgad Shaneh <[email protected]> | 2018-09-26 10:02:32 +0000 |
| commit | 7f2bbe9cfb337a6d6c6dc7ef68d86d320006e2ee (patch) | |
| tree | f19209625ef3a669fa7253833d1d1ec17f51f64f /src/plugins/cppcheck/cppchecktrigger.cpp | |
| parent | 9644745b3d9d914e75dd8285e9d0a74a161fad4c (diff) | |
Cppcheck: Reduce uses of auto
Conform to coding rules.
Change-Id: I57600bd450665d5db87710bb2444e39e7ecbf3e3
Reviewed-by: Nikolai Kosjar <[email protected]>
Diffstat (limited to 'src/plugins/cppcheck/cppchecktrigger.cpp')
| -rw-r--r-- | src/plugins/cppcheck/cppchecktrigger.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/cppcheck/cppchecktrigger.cpp b/src/plugins/cppcheck/cppchecktrigger.cpp index 85edf43874c..cac3772948d 100644 --- a/src/plugins/cppcheck/cppchecktrigger.cpp +++ b/src/plugins/cppcheck/cppchecktrigger.cpp @@ -76,19 +76,19 @@ void CppcheckTrigger::checkEditors(const QList<Core::IEditor *> &editors) return; using CppModelManager = CppTools::CppModelManager; - const auto info = CppModelManager::instance()->projectInfo(m_currentProject); + const CppTools::ProjectInfo info = CppModelManager::instance()->projectInfo(m_currentProject); if (!info.isValid()) return; - const auto editorList = !editors.isEmpty() + const QList<Core::IEditor *> editorList = !editors.isEmpty() ? editors : Core::DocumentModel::editorsForOpenedDocuments(); Utils::FileNameList toCheck; - for (const auto editor: editorList) { + for (const Core::IEditor *editor : editorList) { QTC_ASSERT(editor, continue); - const auto document = editor->document(); + Core::IDocument *document = editor->document(); QTC_ASSERT(document, continue); - const auto &path = document->filePath(); + const Utils::FileName &path = document->filePath(); if (path.isEmpty()) continue; @@ -98,7 +98,7 @@ void CppcheckTrigger::checkEditors(const QList<Core::IEditor *> &editors) if (!m_currentProject->isKnownFile(path)) continue; - const auto &pathString = path.toString(); + const QString &pathString = path.toString(); if (!info.sourceFiles().contains(pathString)) continue; @@ -125,15 +125,15 @@ void CppcheckTrigger::removeEditors(const QList<Core::IEditor *> &editors) if (!m_currentProject) return; - const auto editorList = !editors.isEmpty() + const QList<Core::IEditor *> editorList = !editors.isEmpty() ? editors : Core::DocumentModel::editorsForOpenedDocuments(); Utils::FileNameList toRemove; - for (const auto editor: editorList) { + for (const Core::IEditor *editor : editorList) { QTC_ASSERT(editor, return); - const auto document = editor->document(); + const Core::IDocument *document = editor->document(); QTC_ASSERT(document, return); - const auto &path = document->filePath(); + const Utils::FileName &path = document->filePath(); if (path.isEmpty()) return; @@ -156,7 +156,7 @@ void CppcheckTrigger::checkChangedDocument(Core::IDocument *document) if (!m_currentProject) return; - const auto &path = document->filePath(); + const Utils::FileName &path = document->filePath(); QTC_ASSERT(!path.isEmpty(), return); if (!m_checkedFiles.contains(path)) return; |
