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