Commit b09e5663 authored by Daniel Teske's avatar Daniel Teske

CMakeBuildConfiguration: Less qobject_casts more static_casts

CMakeBuildConfigurations can only exist on CMakeProjects

Change-Id: I8501e39f133fea854b953f9739e001cae1f2c0ea
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent ed42fb2e
......@@ -56,12 +56,10 @@ const char CMAKE_BC_ID[] = "CMakeProjectManager.CMakeBuildConfiguration";
const char BUILD_DIRECTORY_KEY[] = "CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory";
} // namespace
CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent) :
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeProject *parent) :
BuildConfiguration(parent, Core::Id(CMAKE_BC_ID))
{
CMakeProject *project = qobject_cast<CMakeProject *>(parent->project());
if (project)
m_buildDirectory = project->defaultBuildDirectory();
m_buildDirectory = parent->defaultBuildDirectory();
}
CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent,
......@@ -175,9 +173,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
if (!canCreate(parent, id))
return 0;
CMakeProject *project = qobject_cast<CMakeProject *>(parent->project());
if (!project)
return 0;
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
bool ok = true;
QString buildConfigurationName = name;
......@@ -191,7 +187,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
if (!ok || buildConfigurationName.isEmpty())
return 0;
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(parent);
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(project);
bc->setDisplayName(buildConfigurationName);
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
......
......@@ -43,6 +43,7 @@ class ToolChain;
namespace CMakeProjectManager {
namespace Internal {
class CMakeProject;
class CMakeBuildConfigurationFactory;
class CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment