CMake: Avoid passing CMakeManager around

Change-Id: I96d7f3785767d1d56ca27a2d0af778edf98d63e1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-01-07 17:30:49 +01:00
parent 53597087c7
commit 1d6c960f05
6 changed files with 30 additions and 46 deletions

View File

@@ -91,13 +91,11 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
{
auto project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
auto manager = static_cast<CMakeManager *>(project->projectManager());
CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
manager, CMakeOpenProjectWizard::ChangeDirectory,
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), CMakeOpenProjectWizard::ChangeDirectory,
&info);
if (copw.exec() == QDialog::Accepted) {
auto project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
}
@@ -107,13 +105,13 @@ void CMakeBuildSettingsWidget::runCMake()
{
if (!ProjectExplorer::ProjectExplorerPlugin::saveModifiedFiles())
return;
auto project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
auto manager = static_cast<CMakeManager *>(project->projectManager());
CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), manager,
CMakeOpenProjectWizard::WantToUpdate, &info);
if (copw.exec() == QDialog::Accepted)
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), CMakeOpenProjectWizard::WantToUpdate,
&info);
if (copw.exec() == QDialog::Accepted) {
auto project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
project->parseCMakeLists();
}
}
} // namespace Internal
} // namespace CMakeProjectManager