Commit e26617c3 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

CMake: Simplify setup of CMakeOpenProjectWizard



The information is contained in the BuildInfo, so there is no
need to provide it a second time.

Change-Id: I512d148e36996130fab6d8e007dd16d5acebaebb
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent d63186d6
...@@ -96,9 +96,7 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog() ...@@ -96,9 +96,7 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
CMakeBuildInfo info(m_buildConfiguration); CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
manager, CMakeOpenProjectWizard::ChangeDirectory, manager, CMakeOpenProjectWizard::ChangeDirectory,
&info, &info);
m_buildConfiguration->target()->displayName(),
m_buildConfiguration->displayName());
if (copw.exec() == QDialog::Accepted) { if (copw.exec() == QDialog::Accepted) {
project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory()); project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString()); m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
...@@ -113,9 +111,7 @@ void CMakeBuildSettingsWidget::runCMake() ...@@ -113,9 +111,7 @@ void CMakeBuildSettingsWidget::runCMake()
auto manager = static_cast<CMakeManager *>(project->projectManager()); auto manager = static_cast<CMakeManager *>(project->projectManager());
CMakeBuildInfo info(m_buildConfiguration); CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), manager, CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), manager,
CMakeOpenProjectWizard::WantToUpdate, &info, CMakeOpenProjectWizard::WantToUpdate, &info);
m_buildConfiguration->target()->displayName(),
m_buildConfiguration->displayName());
if (copw.exec() == QDialog::Accepted) if (copw.exec() == QDialog::Accepted)
project->parseCMakeLists(); project->parseCMakeLists();
} }
......
...@@ -84,9 +84,7 @@ using namespace ProjectExplorer; ...@@ -84,9 +84,7 @@ using namespace ProjectExplorer;
////////////// //////////////
CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager,
CMakeOpenProjectWizard::Mode mode, CMakeOpenProjectWizard::Mode mode,
const CMakeBuildInfo *info, const CMakeBuildInfo *info)
const QString &kitName,
const QString &buildConfigurationName)
: Utils::Wizard(parent), : Utils::Wizard(parent),
m_cmakeManager(cmakeManager), m_cmakeManager(cmakeManager),
m_sourceDirectory(info->sourceDirectory), m_sourceDirectory(info->sourceDirectory),
...@@ -112,7 +110,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cm ...@@ -112,7 +110,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cm
addPage(new NoCMakePage(this)); addPage(new NoCMakePage(this));
addPage(new CMakeRunPage(this, rmode, info->buildDirectory.toString(), info->arguments, addPage(new CMakeRunPage(this, rmode, info->buildDirectory.toString(), info->arguments,
kitName, buildConfigurationName)); m_kit->displayName(), info->displayName));
init(); init();
} }
......
...@@ -77,11 +77,8 @@ public: ...@@ -77,11 +77,8 @@ public:
/// used to update if we have already a .user file /// used to update if we have already a .user file
/// recreates or updates the cbp file /// recreates or updates the cbp file
/// Also used to change the build directory of one buildconfiguration or create a new buildconfiguration /// Also used to change the build directory of one buildconfiguration or create a new buildconfiguration
CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, Mode mode,
Mode mode, const CMakeBuildInfo *info);
const CMakeBuildInfo *info,
const QString &kitName,
const QString &buildConfigurationName);
QString buildDirectory() const; QString buildDirectory() const;
QString sourceDirectory() const; QString sourceDirectory() const;
......
...@@ -145,8 +145,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur ...@@ -145,8 +145,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
if (mode != CMakeOpenProjectWizard::Nothing) { if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(cmakebc); CMakeBuildInfo info(cmakebc);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info, CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
bc->target()->displayName(), bc->displayName());
if (copw.exec() == QDialog::Accepted) if (copw.exec() == QDialog::Accepted)
cmakebc->setInitialArguments(QString()); cmakebc->setInitialArguments(QString());
} }
...@@ -566,8 +565,7 @@ Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *er ...@@ -566,8 +565,7 @@ Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *er
if (mode != CMakeOpenProjectWizard::Nothing) { if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(activeBC); CMakeBuildInfo info(activeBC);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info, CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
activeBC->target()->displayName(), activeBC->displayName());
if (copw.exec() != QDialog::Accepted) if (copw.exec() != QDialog::Accepted)
return RestoreResult::UserAbort; return RestoreResult::UserAbort;
else else
......
...@@ -113,7 +113,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project) ...@@ -113,7 +113,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project)
CMakeBuildInfo info(bc); CMakeBuildInfo info(bc);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), this, CMakeOpenProjectWizard::WantToUpdate, CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), this, CMakeOpenProjectWizard::WantToUpdate,
&info, project->activeTarget()->displayName(), bc->displayName()); &info);
if (copw.exec() == QDialog::Accepted) if (copw.exec() == QDialog::Accepted)
cmakeProject->parseCMakeLists(); cmakeProject->parseCMakeLists();
} }
......
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