diff --git a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp index bafcbb436d0dbac013123aeb144f076d435ca13b..bae8620997e67b90b30a3874838ec4058682d2ee 100644 --- a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp @@ -151,7 +151,7 @@ void CMakeCbpParser::sortFiles() qCDebug(log) << target.title << target.sourceDirectory << target.includeFiles << target.defines << target.files << "\n"; } -bool CMakeCbpParser::parseCbpFile(Kit *kit, const QString &fileName, const QString &sourceDirectory) +bool CMakeCbpParser::parseCbpFile(const Kit *const kit, const QString &fileName, const QString &sourceDirectory) { m_kit = kit; m_buildDirectory = QFileInfo(fileName).absolutePath(); @@ -437,14 +437,14 @@ void CMakeCbpParser::parseUnit() fileName = FileName::fromUserInput(mappedFile); } - m_parsingCmakeUnit = false; + m_parsingCMakeUnit = false; m_unitTarget.clear(); while (!atEnd()) { readNext(); if (isEndElement()) { if (!fileName.endsWith(QLatin1String(".rule")) && !m_processedUnits.contains(fileName)) { // Now check whether we found a virtual element beneath - if (m_parsingCmakeUnit) { + if (m_parsingCMakeUnit) { m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false)); } else { bool generated = false; @@ -475,7 +475,7 @@ void CMakeCbpParser::parseUnit() void CMakeCbpParser::parseUnitOption() { const QXmlStreamAttributes optionAttributes = attributes(); - m_parsingCmakeUnit = optionAttributes.hasAttribute(QLatin1String("virtualFolder")); + m_parsingCMakeUnit = optionAttributes.hasAttribute(QLatin1String("virtualFolder")); m_unitTarget = optionAttributes.value(QLatin1String("target")).toString(); while (!atEnd()) { diff --git a/src/plugins/cmakeprojectmanager/cmakecbpparser.h b/src/plugins/cmakeprojectmanager/cmakecbpparser.h index 045bdecd1f4dbce39b8f774f253cd45582cc0590..d9dfa771c9233a403fd9e73736afb0d43b85739d 100644 --- a/src/plugins/cmakeprojectmanager/cmakecbpparser.h +++ b/src/plugins/cmakeprojectmanager/cmakecbpparser.h @@ -27,13 +27,18 @@ #include "cmakeproject.h" -#include <QXmlStreamReader> +#include <utils/fileutils.h> +#include <QList> +#include <QMap> +#include <QSet> +#include <QString> +#include <QXmlStreamReader> namespace ProjectExplorer { class FileNode; class Kit; -} +} // namespace ProjectExplorer namespace CMakeProjectManager { namespace Internal { @@ -41,7 +46,8 @@ namespace Internal { class CMakeCbpParser : public QXmlStreamReader { public: - bool parseCbpFile(ProjectExplorer::Kit *kit, const QString &fileName, const QString &sourceDirectory); + bool parseCbpFile(const ProjectExplorer::Kit *const kit, const QString &fileName, + const QString &sourceDirectory); QList<ProjectExplorer::FileNode *> fileList(); QList<ProjectExplorer::FileNode *> cmakeFileList(); QList<CMakeBuildTarget> buildTargets(); @@ -67,11 +73,11 @@ private: void sortFiles(); QMap<Utils::FileName, QString> m_unitTargetMap; - ProjectExplorer::Kit *m_kit = 0; + const ProjectExplorer::Kit *m_kit = 0; QList<ProjectExplorer::FileNode *> m_fileList; QList<ProjectExplorer::FileNode *> m_cmakeFileList; QSet<Utils::FileName> m_processedUnits; - bool m_parsingCmakeUnit; + bool m_parsingCMakeUnit; CMakeBuildTarget m_buildTarget; QList<CMakeBuildTarget> m_buildTargets; diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index d8c2b742c85a2ecf11838518280cf9ede1f2c274..8ea7fdead900d85e55f2d1f11e838083a1664ae5 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -37,7 +37,7 @@ #include <QUuid> #include <QVariantMap> -using namespace CMakeProjectManager; +namespace CMakeProjectManager { const char CMAKE_INFORMATION_ID[] = "Id"; const char CMAKE_INFORMATION_COMMAND[] = "Binary"; @@ -223,7 +223,7 @@ void CMakeTool::setPathMapper(const CMakeTool::PathMapper &pathMapper) m_pathMapper = pathMapper; } -QString CMakeTool::mapAllPaths(ProjectExplorer::Kit *kit, const QString &in) const +QString CMakeTool::mapAllPaths(const ProjectExplorer::Kit *kit, const QString &in) const { if (m_pathMapper) return m_pathMapper(kit, in); @@ -318,3 +318,5 @@ QStringList CMakeTool::parseVariableOutput(const QString &output) } return result; } + +} // namespace CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index eb085bf9db615c23485d775421ca3a13a49fdcb9..bef9f23c353c7eb9a98bbaed982ea100e3e21707 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -52,7 +52,7 @@ public: AutoDetection }; - typedef std::function<QString (ProjectExplorer::Kit *, const QString &)> PathMapper; + typedef std::function<QString (const ProjectExplorer::Kit *, const QString &)> PathMapper; explicit CMakeTool(Detection d, const Core::Id &id); explicit CMakeTool(const QVariantMap &map, bool fromSdk); @@ -78,7 +78,7 @@ public: void setDisplayName(const QString &displayName); void setPathMapper(const PathMapper &includePathMapper); - QString mapAllPaths(ProjectExplorer::Kit *kit, const QString &in) const; + QString mapAllPaths(const ProjectExplorer::Kit *kit, const QString &in) const; private: Utils::SynchronousProcessResponse run(const QString &arg) const;