forked from qt-creator/qt-creator
CMake: Remove handling of legacy settings for CMake
Remove the code that reads CMake tool location from the Qt Creator settings and then removes them from there. This code was added in QtC 4.1 to ease transition to the (back then) new cmaketools.xml settings file. Change-Id: Ice96628159f4171716882cfdefc8991ec2341556 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -110,35 +110,6 @@ static QList<CMakeTool *> readCMakeTools(const FileName &fileName, Core::Id *def
|
|||||||
return loaded;
|
return loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void readAndDeleteLegacyCMakeSettings ()
|
|
||||||
{
|
|
||||||
// restore the legacy cmake
|
|
||||||
QSettings *settings = ICore::settings();
|
|
||||||
settings->beginGroup(QLatin1String("CMakeSettings"));
|
|
||||||
|
|
||||||
FileName exec = FileName::fromUserInput(settings->value(QLatin1String("cmakeExecutable")).toString());
|
|
||||||
if (exec.toFileInfo().isExecutable()) {
|
|
||||||
CMakeTool *item = CMakeToolManager::findByCommand(exec);
|
|
||||||
if (!item) {
|
|
||||||
item = new CMakeTool(CMakeTool::ManualDetection, CMakeTool::createId());
|
|
||||||
item->setCMakeExecutable(exec);
|
|
||||||
item->setDisplayName(CMakeToolManager::tr("CMake at %1").arg(item->cmakeExecutable().toUserOutput()));
|
|
||||||
|
|
||||||
if (!CMakeToolManager::registerCMakeTool(item)) {
|
|
||||||
delete item;
|
|
||||||
item = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//this setting used to be the default cmake, make sure it is again
|
|
||||||
if (item)
|
|
||||||
d->m_defaultCMake = item->id();
|
|
||||||
}
|
|
||||||
|
|
||||||
settings->remove(QString());
|
|
||||||
settings->endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
static QList<CMakeTool *> autoDetectCMakeTools()
|
static QList<CMakeTool *> autoDetectCMakeTools()
|
||||||
{
|
{
|
||||||
Utils::Environment env = Environment::systemEnvironment();
|
Utils::Environment env = Environment::systemEnvironment();
|
||||||
@@ -387,8 +358,6 @@ void CMakeToolManager::restoreCMakeTools()
|
|||||||
if (CMakeToolManager::findById(defaultId))
|
if (CMakeToolManager::findById(defaultId))
|
||||||
d->m_defaultCMake = defaultId;
|
d->m_defaultCMake = defaultId;
|
||||||
|
|
||||||
// restore the legacy cmake settings only once and keep them around
|
|
||||||
readAndDeleteLegacyCMakeSettings();
|
|
||||||
emit m_instance->cmakeToolsLoaded();
|
emit m_instance->cmakeToolsLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user