summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2018-06-29 13:48:37 +0200
committerTobias Hunger <tobias.hunger@qt.io>2018-07-02 09:54:26 +0000
commit2127f96f5f8c42ab031d70e83e40bee4119b0851 (patch)
tree4e5e19235bd0a01e71385173c0cdd34ab8396e1e /src/plugins/cmakeprojectmanager
parentc08aab7b9644e84db52fbc062973ac135d9b298c (diff)
downloadqt-creator-2127f96f5f8c42ab031d70e83e40bee4119b0851.tar.gz
CMake: Remove CMakeTool::addCMakeTool method
Change-Id: I9c6abb58711acc14ae78d79b6f077034389c0a6f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r--src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp24
-rw-r--r--src/plugins/cmakeprojectmanager/cmaketoolmanager.h1
2 files changed, 9 insertions, 16 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
index 794b3ac0cc..19e3c7d548 100644
--- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
+++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
@@ -250,7 +250,7 @@ Id CMakeToolManager::registerOrFindCMakeTool(const FileName &command)
cmake->setCMakeExecutable(command);
cmake->setDisplayName(tr("CMake at %1").arg(command.toUserOutput()));
- addCMakeTool(cmake);
+ QTC_ASSERT(registerCMakeTool(cmake), return Core::Id());
return cmake->id();
}
@@ -267,7 +267,14 @@ bool CMakeToolManager::registerCMakeTool(CMakeTool *tool)
return false;
}
- addCMakeTool(tool);
+ d->m_cmakeTools.append(tool);
+
+ emit CMakeToolManager::m_instance->cmakeAdded(tool->id());
+
+ //set the first registered cmake tool as default if there is not already one
+ if (!d->m_defaultCMake.isValid())
+ CMakeToolManager::setDefaultCMakeTool(tool->id());
+
return true;
}
@@ -391,17 +398,4 @@ void CMakeToolManager::saveCMakeTools()
d->m_writer->save(data, ICore::mainWindow());
}
-void CMakeToolManager::addCMakeTool(CMakeTool *item)
-{
- QTC_ASSERT(item->id().isValid(), return);
-
- d->m_cmakeTools.append(item);
-
- emit CMakeToolManager::m_instance->cmakeAdded(item->id());
-
- //set the first registered cmake tool as default if there is not already one
- if (!d->m_defaultCMake.isValid())
- CMakeToolManager::setDefaultCMakeTool(item->id());
-}
-
} // namespace CMakeProjectManager
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h
index 690109a339..f3c4c92cd3 100644
--- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h
+++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h
@@ -69,7 +69,6 @@ signals:
private:
static void saveCMakeTools();
- static void addCMakeTool(CMakeTool *item);
static CMakeToolManager *m_instance;
};