forked from qt-creator/qt-creator
Cmake: use new Core::Id interfaces
Change-Id: I3fee4afb72231833abf177d334c881c7b646fb9e Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -528,7 +528,7 @@ bool CMakeRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, Pro
|
|||||||
{
|
{
|
||||||
if (!canHandle(parent))
|
if (!canHandle(parent))
|
||||||
return false;
|
return false;
|
||||||
return source->id().toString().startsWith(QLatin1String(CMAKE_RC_PREFIX));
|
return source->id().name().startsWith(CMAKE_RC_PREFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration * source)
|
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration * source)
|
||||||
@@ -543,8 +543,7 @@ bool CMakeRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, c
|
|||||||
{
|
{
|
||||||
if (!qobject_cast<CMakeProject *>(parent->project()))
|
if (!qobject_cast<CMakeProject *>(parent->project()))
|
||||||
return false;
|
return false;
|
||||||
QString id = QString::fromUtf8(ProjectExplorer::idFromMap(map).name());
|
return ProjectExplorer::idFromMap(map).name().startsWith(CMAKE_RC_PREFIX);
|
||||||
return id.startsWith(QLatin1String(CMAKE_RC_PREFIX));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
|
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
|
||||||
@@ -561,14 +560,10 @@ ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(Project
|
|||||||
|
|
||||||
QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id)
|
QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id)
|
||||||
{
|
{
|
||||||
QString idstr = QString::fromUtf8(id.name());
|
return id.suffixAfter(CMAKE_RC_PREFIX);
|
||||||
if (!idstr.startsWith(QLatin1String(CMAKE_RC_PREFIX)))
|
|
||||||
return QString();
|
|
||||||
return idstr.mid(QString::fromLatin1(CMAKE_RC_PREFIX).length());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id CMakeRunConfigurationFactory::idFromBuildTarget(const QString &target)
|
Core::Id CMakeRunConfigurationFactory::idFromBuildTarget(const QString &target)
|
||||||
{
|
{
|
||||||
QString id = QString::fromLatin1(CMAKE_RC_PREFIX) + target;
|
return Core::Id(CMAKE_RC_PREFIX).withSuffix(target);
|
||||||
return Core::Id(id.toUtf8());
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user