forked from qt-creator/qt-creator
Move a bit closer to Qt Creator coding style
- use m_member prefix convention - bind some * to the identifier - remove some unusual comments Change-Id: Ife9b148b54c3f930561e2de79a016dfcfe0487a0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -70,7 +70,7 @@ BuildConfiguration::BuildConfiguration(Target* parent, Core::Id const id)
|
|||||||
QVariantMap BuildConfiguration::toMap() const
|
QVariantMap BuildConfiguration::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map(ProjectExplorer::BuildConfiguration::toMap());
|
QVariantMap map(ProjectExplorer::BuildConfiguration::toMap());
|
||||||
map.insert(QLatin1String(Constants::BC_KEY_WORKDIR), workingDirectory_.toString());
|
map.insert(QLatin1String(Constants::BC_KEY_WORKDIR), m_workingDirectory.toString());
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,8 +111,8 @@ BuildConfiguration::buildType() const
|
|||||||
|
|
||||||
Utils::FileName BuildConfiguration::workingDirectory() const
|
Utils::FileName BuildConfiguration::workingDirectory() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(!workingDirectory_.isEmpty());
|
Q_ASSERT(!m_workingDirectory.isEmpty());
|
||||||
return workingDirectory_;
|
return m_workingDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildConfiguration::setWorkingDirectory(Utils::FileName const& dir)
|
void BuildConfiguration::setWorkingDirectory(Utils::FileName const& dir)
|
||||||
@@ -121,20 +121,20 @@ void BuildConfiguration::setWorkingDirectory(Utils::FileName const& dir)
|
|||||||
if (Target* t = target()) {
|
if (Target* t = target()) {
|
||||||
QString const dwd
|
QString const dwd
|
||||||
= Project::defaultWorkingDirectory(t->project()->projectDirectory().toString());
|
= Project::defaultWorkingDirectory(t->project()->projectDirectory().toString());
|
||||||
workingDirectory_ = Utils::FileName::fromString(dwd);
|
m_workingDirectory = Utils::FileName::fromString(dwd);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
workingDirectory_ = dir;
|
m_workingDirectory = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT(!workingDirectory_.isEmpty());
|
Q_ASSERT(!m_workingDirectory.isEmpty());
|
||||||
emitWorkingDirectoryChanged();
|
emitWorkingDirectoryChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildConfiguration::emitWorkingDirectoryChanged()
|
void BuildConfiguration::emitWorkingDirectoryChanged()
|
||||||
{
|
{
|
||||||
if (workingDirectory() != lastEmmitedWorkingDirectory_) {
|
if (workingDirectory() != m_lastEmmitedWorkingDirectory) {
|
||||||
lastEmmitedWorkingDirectory_= workingDirectory();
|
m_lastEmmitedWorkingDirectory= workingDirectory();
|
||||||
emit workingDirectoryChanged();
|
emit workingDirectoryChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,8 +332,8 @@ BuildConfigurationFactory::defaultWorkingDirectory(QString const& top)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BuildSettingsWidget::BuildSettingsWidget(BuildConfiguration* bc)
|
BuildSettingsWidget::BuildSettingsWidget(BuildConfiguration* bc)
|
||||||
: bc_(bc)
|
: m_bc(bc)
|
||||||
, buildPathChooser_(0)
|
, m_buildPathChooser(0)
|
||||||
{
|
{
|
||||||
setDisplayName(tr("Boost.Build Manager"));
|
setDisplayName(tr("Boost.Build Manager"));
|
||||||
|
|
||||||
@@ -341,28 +341,28 @@ BuildSettingsWidget::BuildSettingsWidget(BuildConfiguration* bc)
|
|||||||
fl->setContentsMargins(0, -1, 0, -1);
|
fl->setContentsMargins(0, -1, 0, -1);
|
||||||
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
|
|
||||||
QString const projectPath(bc_->target()->project()->projectDirectory().toString());
|
QString const projectPath(m_bc->target()->project()->projectDirectory().toString());
|
||||||
|
|
||||||
// Working directory
|
// Working directory
|
||||||
workPathChooser_ = new Utils::PathChooser(this);
|
m_workPathChooser = new Utils::PathChooser(this);
|
||||||
workPathChooser_->setEnabled(true);
|
m_workPathChooser->setEnabled(true);
|
||||||
workPathChooser_->setEnvironment(bc_->environment());
|
m_workPathChooser->setEnvironment(m_bc->environment());
|
||||||
workPathChooser_->setBaseDirectory(projectPath);
|
m_workPathChooser->setBaseDirectory(projectPath);
|
||||||
workPathChooser_->setPath(bc_->workingDirectory().toString());
|
m_workPathChooser->setPath(m_bc->workingDirectory().toString());
|
||||||
fl->addRow(tr("Run Boost.Build in:"), workPathChooser_);
|
fl->addRow(tr("Run Boost.Build in:"), m_workPathChooser);
|
||||||
|
|
||||||
// Build directory
|
// Build directory
|
||||||
buildPathChooser_ = new Utils::PathChooser(this);
|
m_buildPathChooser = new Utils::PathChooser(this);
|
||||||
buildPathChooser_->setEnabled(true);
|
m_buildPathChooser->setEnabled(true);
|
||||||
buildPathChooser_->setEnvironment(bc_->environment());
|
m_buildPathChooser->setEnvironment(m_bc->environment());
|
||||||
buildPathChooser_->setBaseDirectory(projectPath);
|
m_buildPathChooser->setBaseDirectory(projectPath);
|
||||||
buildPathChooser_->setPath(bc_->rawBuildDirectory().toString());
|
m_buildPathChooser->setPath(m_bc->rawBuildDirectory().toString());
|
||||||
fl->addRow(tr("Set build directory to:"), buildPathChooser_);
|
fl->addRow(tr("Set build directory to:"), m_buildPathChooser);
|
||||||
|
|
||||||
connect(workPathChooser_, SIGNAL(changed(QString))
|
connect(m_workPathChooser, SIGNAL(changed(QString))
|
||||||
, this, SLOT(workingDirectoryChanged()));
|
, this, SLOT(workingDirectoryChanged()));
|
||||||
|
|
||||||
connect(buildPathChooser_, SIGNAL(changed(QString))
|
connect(m_buildPathChooser, SIGNAL(changed(QString))
|
||||||
, this, SLOT(buildDirectoryChanged()));
|
, this, SLOT(buildDirectoryChanged()));
|
||||||
|
|
||||||
connect(bc, SIGNAL(environmentChanged())
|
connect(bc, SIGNAL(environmentChanged())
|
||||||
@@ -371,20 +371,20 @@ BuildSettingsWidget::BuildSettingsWidget(BuildConfiguration* bc)
|
|||||||
|
|
||||||
void BuildSettingsWidget::buildDirectoryChanged()
|
void BuildSettingsWidget::buildDirectoryChanged()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(bc_, return);
|
QTC_ASSERT(m_bc, return);
|
||||||
bc_->setBuildDirectory(Utils::FileName::fromString(buildPathChooser_->rawPath()));
|
m_bc->setBuildDirectory(Utils::FileName::fromString(m_buildPathChooser->rawPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildSettingsWidget::workingDirectoryChanged()
|
void BuildSettingsWidget::workingDirectoryChanged()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(bc_, return);
|
QTC_ASSERT(m_bc, return);
|
||||||
bc_->setWorkingDirectory(Utils::FileName::fromString(workPathChooser_->rawPath()));
|
m_bc->setWorkingDirectory(Utils::FileName::fromString(m_workPathChooser->rawPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildSettingsWidget::environmentHasChanged()
|
void BuildSettingsWidget::environmentHasChanged()
|
||||||
{
|
{
|
||||||
Q_ASSERT(buildPathChooser_);
|
Q_ASSERT(m_buildPathChooser);
|
||||||
buildPathChooser_->setEnvironment(bc_->environment());
|
m_buildPathChooser->setEnvironment(m_bc->environment());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -12,11 +12,10 @@
|
|||||||
#ifndef BBBUILDCONFIGURATION_HPP
|
#ifndef BBBUILDCONFIGURATION_HPP
|
||||||
#define BBBUILDCONFIGURATION_HPP
|
#define BBBUILDCONFIGURATION_HPP
|
||||||
|
|
||||||
// Qt Creator
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/namedwidget.h>
|
#include <projectexplorer/namedwidget.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
// Qt
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
@@ -65,8 +64,8 @@ private slots:
|
|||||||
void emitWorkingDirectoryChanged();
|
void emitWorkingDirectoryChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Utils::FileName workingDirectory_;
|
Utils::FileName m_workingDirectory;
|
||||||
Utils::FileName lastEmmitedWorkingDirectory_;
|
Utils::FileName m_lastEmmitedWorkingDirectory;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
|
class BuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
|
||||||
@@ -127,9 +126,9 @@ private slots:
|
|||||||
void workingDirectoryChanged();
|
void workingDirectoryChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BuildConfiguration* bc_;
|
BuildConfiguration *m_bc;
|
||||||
Utils::PathChooser* workPathChooser_;
|
Utils::PathChooser *m_workPathChooser;
|
||||||
Utils::PathChooser* buildPathChooser_;
|
Utils::PathChooser *m_buildPathChooser;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -13,11 +13,10 @@
|
|||||||
#define BBBUILDINFO_HPP
|
#define BBBUILDINFO_HPP
|
||||||
|
|
||||||
#include "b2buildconfiguration.h"
|
#include "b2buildconfiguration.h"
|
||||||
// Qt Creator
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildinfo.h>
|
#include <projectexplorer/buildinfo.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
// Qt
|
|
||||||
|
|
||||||
namespace BoostBuildProjectManager {
|
namespace BoostBuildProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#include "b2projectmanagerconstants.h"
|
#include "b2projectmanagerconstants.h"
|
||||||
#include "b2utility.h"
|
#include "b2utility.h"
|
||||||
#include "filesselectionwizardpage.h"
|
#include "filesselectionwizardpage.h"
|
||||||
// Qt Creator
|
|
||||||
#include <coreplugin/iwizardfactory.h>
|
#include <coreplugin/iwizardfactory.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/customwizard/customwizard.h>
|
#include <projectexplorer/customwizard/customwizard.h>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
// Qt
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@@ -37,12 +37,12 @@ namespace Internal {
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
OpenProjectWizard::OpenProjectWizard(Project const* const project)
|
OpenProjectWizard::OpenProjectWizard(Project const* const project)
|
||||||
: project_(project)
|
: m_project(project)
|
||||||
, projectOpened_(false)
|
, m_projectOpened(false)
|
||||||
{
|
{
|
||||||
// Project instance has been created, but it's only partially initialised and
|
// Project instance has been created, but it's only partially initialised and
|
||||||
// rest of the initialization takes place after this wizard completes.
|
// rest of the initialization takes place after this wizard completes.
|
||||||
Q_ASSERT(project_);
|
Q_ASSERT(m_project);
|
||||||
|
|
||||||
setDisplayName(tr("Open %1 Project").arg(BBPM_C(BOOSTBUILD)));
|
setDisplayName(tr("Open %1 Project").arg(BBPM_C(BOOSTBUILD)));
|
||||||
setId(BBPM_C(PROJECT_WIZARD_ID));
|
setId(BBPM_C(PROJECT_WIZARD_ID));
|
||||||
@@ -58,21 +58,21 @@ bool OpenProjectWizard::run(QString const& platform, QVariantMap const& extraVal
|
|||||||
// Project name should be passed by caller, but,
|
// Project name should be passed by caller, but,
|
||||||
// since we have Project instance handy, double-check.
|
// since we have Project instance handy, double-check.
|
||||||
if (!extraValuesCopy.contains(BBPM_C(P_KEY_PROJECTNAME)))
|
if (!extraValuesCopy.contains(BBPM_C(P_KEY_PROJECTNAME)))
|
||||||
extraValuesCopy.insert(BBPM_C(P_KEY_PROJECTNAME), project_->displayName());
|
extraValuesCopy.insert(BBPM_C(P_KEY_PROJECTNAME), m_project->displayName());
|
||||||
|
|
||||||
projectOpened_ = false;
|
m_projectOpened = false;
|
||||||
outputValues_.clear();
|
m_outputValues.clear();
|
||||||
|
|
||||||
runWizard(project_->projectFilePath().toString(), 0, platform, extraValuesCopy);
|
runWizard(m_project->projectFilePath().toString(), 0, platform, extraValuesCopy);
|
||||||
|
|
||||||
return projectOpened_;
|
return m_projectOpened;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::BaseFileWizard *OpenProjectWizard::create(QWidget* parent, Core::WizardDialogParameters const& parameters) const
|
Core::BaseFileWizard *OpenProjectWizard::create(QWidget* parent, Core::WizardDialogParameters const& parameters) const
|
||||||
{
|
{
|
||||||
OpenProjectWizardDialog* wizard(new OpenProjectWizardDialog(parent
|
OpenProjectWizardDialog* wizard(new OpenProjectWizardDialog(parent
|
||||||
, parameters.defaultPath(), parameters.extraValues()
|
, parameters.defaultPath(), parameters.extraValues()
|
||||||
, const_cast<OpenProjectWizard*>(this)->outputValues_));
|
, const_cast<OpenProjectWizard*>(this)->m_outputValues));
|
||||||
|
|
||||||
foreach (QWizardPage* p, parameters.extensionPages())
|
foreach (QWizardPage* p, parameters.extensionPages())
|
||||||
wizard->addPage(p);
|
wizard->addPage(p);
|
||||||
@@ -84,7 +84,7 @@ Core::GeneratedFiles
|
|||||||
OpenProjectWizard::generateFiles(QWizard const* wizard, QString* errorMessage) const
|
OpenProjectWizard::generateFiles(QWizard const* wizard, QString* errorMessage) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
Q_ASSERT(project_);
|
Q_ASSERT(m_project);
|
||||||
|
|
||||||
OpenProjectWizardDialog const* openWizard
|
OpenProjectWizardDialog const* openWizard
|
||||||
= qobject_cast<OpenProjectWizardDialog const*>(wizard);
|
= qobject_cast<OpenProjectWizardDialog const*>(wizard);
|
||||||
@@ -121,10 +121,10 @@ OpenProjectWizard::generateFiles(QWizard const* wizard, QString* errorMessage) c
|
|||||||
QStringList sources = openWizard->selectedFiles();
|
QStringList sources = openWizard->selectedFiles();
|
||||||
Utility::makeRelativePaths(projectDir.absolutePath(), sources);
|
Utility::makeRelativePaths(projectDir.absolutePath(), sources);
|
||||||
|
|
||||||
Core::GeneratedFile generatedFilesFile(project_->filesFilePath());
|
Core::GeneratedFile generatedFilesFile(m_project->filesFilePath());
|
||||||
generatedFilesFile.setContents(sources.join(QLatin1String("\n")));
|
generatedFilesFile.setContents(sources.join(QLatin1String("\n")));
|
||||||
|
|
||||||
Core::GeneratedFile generatedIncludesFile(project_->includesFilePath());
|
Core::GeneratedFile generatedIncludesFile(m_project->includesFilePath());
|
||||||
generatedIncludesFile.setContents(includePaths.join(QLatin1String("\n")));
|
generatedIncludesFile.setContents(includePaths.join(QLatin1String("\n")));
|
||||||
|
|
||||||
Core::GeneratedFiles files;
|
Core::GeneratedFiles files;
|
||||||
@@ -139,10 +139,10 @@ OpenProjectWizard::postGenerateFiles(QWizard const* wizard
|
|||||||
{
|
{
|
||||||
Q_UNUSED(wizard);
|
Q_UNUSED(wizard);
|
||||||
|
|
||||||
projectOpened_
|
m_projectOpened
|
||||||
= ProjectExplorer::CustomProjectWizard::postGenerateOpen(files, errorMessage);
|
= ProjectExplorer::CustomProjectWizard::postGenerateOpen(files, errorMessage);
|
||||||
|
|
||||||
return projectOpened_;
|
return m_projectOpened;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -150,20 +150,20 @@ OpenProjectWizardDialog::OpenProjectWizardDialog(QWidget* parent
|
|||||||
, QString const& projectFile
|
, QString const& projectFile
|
||||||
, QVariantMap const& extraValues, QVariantMap& outputValues)
|
, QVariantMap const& extraValues, QVariantMap& outputValues)
|
||||||
: Core::BaseFileWizard(parent)
|
: Core::BaseFileWizard(parent)
|
||||||
, outputValues_(outputValues)
|
, m_outputValues(outputValues)
|
||||||
, extraValues_(extraValues)
|
, m_extraValues(extraValues)
|
||||||
, projectFile_(projectFile)
|
, m_projectFile(projectFile)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Open %1 Project").arg(BBPM_C(BOOSTBUILD)));
|
setWindowTitle(tr("Open %1 Project").arg(BBPM_C(BOOSTBUILD)));
|
||||||
|
|
||||||
pathsPage_ = new PathsSelectionWizardPage(this);
|
m_pathsPage = new PathsSelectionWizardPage(this);
|
||||||
pathsPage_->setTitle(tr("Project Name and Paths"));
|
m_pathsPage->setTitle(tr("Project Name and Paths"));
|
||||||
int const pathsPageId = addPage(pathsPage_);
|
int const pathsPageId = addPage(m_pathsPage);
|
||||||
wizardProgress()->item(pathsPageId)->setTitle(tr("Location"));
|
wizardProgress()->item(pathsPageId)->setTitle(tr("Location"));
|
||||||
|
|
||||||
filesPage_ = new FilesSelectionWizardPage(this);
|
m_filesPage = new FilesSelectionWizardPage(this);
|
||||||
filesPage_->setTitle(tr("File Selection"));
|
m_filesPage->setTitle(tr("File Selection"));
|
||||||
int const filesPageId = addPage(filesPage_);
|
int const filesPageId = addPage(m_filesPage);
|
||||||
wizardProgress()->item(filesPageId)->setTitle(tr("Files"));
|
wizardProgress()->item(filesPageId)->setTitle(tr("Files"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,38 +178,38 @@ QString OpenProjectWizardDialog::path() const
|
|||||||
|
|
||||||
QString OpenProjectWizardDialog::projectFile() const
|
QString OpenProjectWizardDialog::projectFile() const
|
||||||
{
|
{
|
||||||
return projectFile_;
|
return m_projectFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OpenProjectWizardDialog::projectName() const
|
QString OpenProjectWizardDialog::projectName() const
|
||||||
{
|
{
|
||||||
return pathsPage_->projectName();
|
return m_pathsPage->projectName();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OpenProjectWizardDialog::defaultProjectName() const
|
QString OpenProjectWizardDialog::defaultProjectName() const
|
||||||
{
|
{
|
||||||
return extraValues_.value(BBPM_C(P_KEY_PROJECTNAME)).toString();
|
return m_extraValues.value(BBPM_C(P_KEY_PROJECTNAME)).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList OpenProjectWizardDialog::selectedFiles() const
|
QStringList OpenProjectWizardDialog::selectedFiles() const
|
||||||
{
|
{
|
||||||
return filesPage_->selectedFiles();
|
return m_filesPage->selectedFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList OpenProjectWizardDialog::selectedPaths() const
|
QStringList OpenProjectWizardDialog::selectedPaths() const
|
||||||
{
|
{
|
||||||
return filesPage_->selectedPaths();
|
return m_filesPage->selectedPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenProjectWizardDialog::setProjectName(QString const& name)
|
void OpenProjectWizardDialog::setProjectName(QString const& name)
|
||||||
{
|
{
|
||||||
outputValues_.insert(QLatin1String(Constants::P_KEY_PROJECTNAME), name);
|
m_outputValues.insert(QLatin1String(Constants::P_KEY_PROJECTNAME), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
PathsSelectionWizardPage::PathsSelectionWizardPage(OpenProjectWizardDialog* wizard)
|
PathsSelectionWizardPage::PathsSelectionWizardPage(OpenProjectWizardDialog* wizard)
|
||||||
: QWizardPage(wizard)
|
: QWizardPage(wizard)
|
||||||
, wizard_(wizard)
|
, m_wizard(wizard)
|
||||||
{
|
{
|
||||||
QFormLayout *fl = new QFormLayout();
|
QFormLayout *fl = new QFormLayout();
|
||||||
setLayout(fl);
|
setLayout(fl);
|
||||||
@@ -221,18 +221,18 @@ PathsSelectionWizardPage::PathsSelectionWizardPage(OpenProjectWizardDialog* wiza
|
|||||||
QLineEdit* pathLine = new QLineEdit(this);
|
QLineEdit* pathLine = new QLineEdit(this);
|
||||||
pathLine->setReadOnly(true);
|
pathLine->setReadOnly(true);
|
||||||
pathLine->setDisabled(true);
|
pathLine->setDisabled(true);
|
||||||
pathLine->setText(wizard_->projectFile());
|
pathLine->setText(m_wizard->projectFile());
|
||||||
fl->addRow(pathLine);
|
fl->addRow(pathLine);
|
||||||
|
|
||||||
QString projectName(Utility::parseJamfileProjectName(wizard_->projectFile()));
|
QString projectName(Utility::parseJamfileProjectName(m_wizard->projectFile()));
|
||||||
if (projectName.isEmpty())
|
if (projectName.isEmpty())
|
||||||
projectName = wizard_->defaultProjectName();
|
projectName = m_wizard->defaultProjectName();
|
||||||
|
|
||||||
nameLineEdit_ = new QLineEdit(this);
|
m_nameLineEdit = new QLineEdit(this);
|
||||||
connect(nameLineEdit_, &QLineEdit::textChanged
|
connect(m_nameLineEdit, &QLineEdit::textChanged
|
||||||
, wizard_, &OpenProjectWizardDialog::setProjectName);
|
, m_wizard, &OpenProjectWizardDialog::setProjectName);
|
||||||
nameLineEdit_->setText(projectName);
|
m_nameLineEdit->setText(projectName);
|
||||||
fl->addRow(tr("Project name:"), nameLineEdit_);
|
fl->addRow(tr("Project name:"), m_nameLineEdit);
|
||||||
|
|
||||||
QLabel* defaultsLabel = new QLabel(this);
|
QLabel* defaultsLabel = new QLabel(this);
|
||||||
defaultsLabel->setText(tr("Default Boost.Build runtime locations:"));
|
defaultsLabel->setText(tr("Default Boost.Build runtime locations:"));
|
||||||
@@ -241,13 +241,13 @@ PathsSelectionWizardPage::PathsSelectionWizardPage(OpenProjectWizardDialog* wiza
|
|||||||
QLineEdit* workingLine = new QLineEdit(this);
|
QLineEdit* workingLine = new QLineEdit(this);
|
||||||
workingLine->setReadOnly(true);
|
workingLine->setReadOnly(true);
|
||||||
workingLine->setDisabled(true);
|
workingLine->setDisabled(true);
|
||||||
workingLine->setText(Project::defaultWorkingDirectory(wizard_->projectFile()));
|
workingLine->setText(Project::defaultWorkingDirectory(m_wizard->projectFile()));
|
||||||
fl->addRow(tr("Working directory:"), workingLine);
|
fl->addRow(tr("Working directory:"), workingLine);
|
||||||
|
|
||||||
QLineEdit* buildLine = new QLineEdit(this);
|
QLineEdit* buildLine = new QLineEdit(this);
|
||||||
buildLine->setReadOnly(true);
|
buildLine->setReadOnly(true);
|
||||||
buildLine->setDisabled(true);
|
buildLine->setDisabled(true);
|
||||||
buildLine->setText(Project::defaultBuildDirectory(wizard_->projectFile()));
|
buildLine->setText(Project::defaultBuildDirectory(m_wizard->projectFile()));
|
||||||
fl->addRow(tr("Build directory:"), buildLine);
|
fl->addRow(tr("Build directory:"), buildLine);
|
||||||
|
|
||||||
// TODO: indicate if we can find Boost.Build executable?
|
// TODO: indicate if we can find Boost.Build executable?
|
||||||
@@ -265,7 +265,7 @@ PathsSelectionWizardPage::PathsSelectionWizardPage(OpenProjectWizardDialog* wiza
|
|||||||
|
|
||||||
QString PathsSelectionWizardPage::projectName() const
|
QString PathsSelectionWizardPage::projectName() const
|
||||||
{
|
{
|
||||||
return nameLineEdit_->text();
|
return m_nameLineEdit->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -13,14 +13,14 @@
|
|||||||
#ifndef BBOPENPROJECTWIZARD_HPP
|
#ifndef BBOPENPROJECTWIZARD_HPP
|
||||||
#define BBOPENPROJECTWIZARD_HPP
|
#define BBOPENPROJECTWIZARD_HPP
|
||||||
|
|
||||||
// Qt Creator
|
|
||||||
#include <coreplugin/basefilewizard.h>
|
#include <coreplugin/basefilewizard.h>
|
||||||
#include <coreplugin/basefilewizardfactory.h>
|
#include <coreplugin/basefilewizardfactory.h>
|
||||||
#include <coreplugin/generatedfile.h>
|
#include <coreplugin/generatedfile.h>
|
||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
// Qt
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
@@ -28,9 +28,7 @@ class QTreeView;
|
|||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils { class PathChooser; }
|
||||||
class PathChooser;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace BoostBuildProjectManager {
|
namespace BoostBuildProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -57,7 +55,7 @@ public:
|
|||||||
|
|
||||||
bool run(QString const& platform, QVariantMap const& extraValues);
|
bool run(QString const& platform, QVariantMap const& extraValues);
|
||||||
|
|
||||||
QVariantMap outputValues() const { return outputValues_; }
|
QVariantMap outputValues() const { return m_outputValues; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -72,9 +70,9 @@ protected:
|
|||||||
, Core::GeneratedFiles const& files, QString* errorMessage);
|
, Core::GeneratedFiles const& files, QString* errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Project const* const project_;
|
Project const* const m_project;
|
||||||
QVariantMap outputValues_;
|
QVariantMap m_outputValues;
|
||||||
bool projectOpened_;
|
bool m_projectOpened;
|
||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -98,11 +96,11 @@ public slots:
|
|||||||
void setProjectName(QString const& name);
|
void setProjectName(QString const& name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariantMap& outputValues_;
|
QVariantMap &m_outputValues;
|
||||||
QVariantMap extraValues_;
|
QVariantMap m_extraValues;
|
||||||
QString projectFile_;
|
QString m_projectFile;
|
||||||
PathsSelectionWizardPage* pathsPage_;
|
PathsSelectionWizardPage *m_pathsPage;
|
||||||
FilesSelectionWizardPage* filesPage_;
|
FilesSelectionWizardPage *m_filesPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -117,8 +115,8 @@ public:
|
|||||||
void setProjectName(QString const& name);
|
void setProjectName(QString const& name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OpenProjectWizardDialog* wizard_;
|
OpenProjectWizardDialog *m_wizard;
|
||||||
QLineEdit* nameLineEdit_;
|
QLineEdit *m_nameLineEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -19,8 +19,7 @@
|
|||||||
#include "b2projectmanagerconstants.h"
|
#include "b2projectmanagerconstants.h"
|
||||||
#include "b2projectnode.h"
|
#include "b2projectnode.h"
|
||||||
#include "b2utility.h"
|
#include "b2utility.h"
|
||||||
// Qt Creator
|
|
||||||
#include <app/app_version.h>
|
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/generatedfile.h>
|
#include <coreplugin/generatedfile.h>
|
||||||
@@ -38,7 +37,7 @@
|
|||||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/QtConcurrentTools>
|
#include <utils/QtConcurrentTools>
|
||||||
// Qt
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -47,13 +46,13 @@ namespace BoostBuildProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
Project::Project(ProjectManager* manager, QString const& fileName)
|
Project::Project(ProjectManager* manager, QString const& fileName)
|
||||||
: manager_(manager)
|
: m_manager(manager)
|
||||||
, filePath_(fileName)
|
, m_filePath(fileName)
|
||||||
, projectFile_(new ProjectFile(this, filePath_)) // enables projectDirectory()
|
, m_projectFile(new ProjectFile(this, m_filePath)) // enables projectDirectory()
|
||||||
, projectNode_(new ProjectNode(this, projectFile_))
|
, m_projectNode(new ProjectNode(this, m_projectFile))
|
||||||
{
|
{
|
||||||
Q_ASSERT(manager_);
|
Q_ASSERT(m_manager);
|
||||||
Q_ASSERT(!filePath_.isEmpty());
|
Q_ASSERT(!m_filePath.isEmpty());
|
||||||
|
|
||||||
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
|
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
|
||||||
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
|
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
|
||||||
@@ -61,17 +60,17 @@ Project::Project(ProjectManager* manager, QString const& fileName)
|
|||||||
setId(Constants::PROJECT_ID);
|
setId(Constants::PROJECT_ID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QFileInfo const projectFileInfo(filePath_);
|
QFileInfo const projectFileInfo(m_filePath);
|
||||||
QDir const projectDir(projectFileInfo.dir());
|
QDir const projectDir(projectFileInfo.dir());
|
||||||
projectName_ = defaultProjectName(filePath_);
|
m_projectName = defaultProjectName(m_filePath);
|
||||||
filesFilePath_ = QFileInfo(projectDir
|
m_filesFilePath = QFileInfo(projectDir
|
||||||
, filePath_ + QLatin1String(Constants::EXT_JAMFILE_FILES)).absoluteFilePath();
|
, m_filePath + QLatin1String(Constants::EXT_JAMFILE_FILES)).absoluteFilePath();
|
||||||
includesFilePath_ = QFileInfo(projectDir
|
m_includesFilePath = QFileInfo(projectDir
|
||||||
, filePath_ + QLatin1String(Constants::EXT_JAMFILE_INCLUDES)).absoluteFilePath();
|
, m_filePath + QLatin1String(Constants::EXT_JAMFILE_INCLUDES)).absoluteFilePath();
|
||||||
|
|
||||||
projectNode_->setDisplayName(displayName());
|
m_projectNode->setDisplayName(displayName());
|
||||||
|
|
||||||
manager_->registerProject(this);
|
m_manager->registerProject(this);
|
||||||
|
|
||||||
// TODO: Add file watchers
|
// TODO: Add file watchers
|
||||||
//projectFileWatcher_->addPath(projectFilePath);
|
//projectFileWatcher_->addPath(projectFilePath);
|
||||||
@@ -82,13 +81,13 @@ Project::Project(ProjectManager* manager, QString const& fileName)
|
|||||||
|
|
||||||
Project::~Project()
|
Project::~Project()
|
||||||
{
|
{
|
||||||
manager_->unregisterProject(this);
|
m_manager->unregisterProject(this);
|
||||||
delete projectNode_;
|
delete m_projectNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Project::displayName() const
|
QString Project::displayName() const
|
||||||
{
|
{
|
||||||
return projectName_;
|
return m_projectName;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IDE_VERSION_MAJOR) && (IDE_VERSION_MAJOR == 3 && IDE_VERSION_MINOR == 0)
|
#if defined(IDE_VERSION_MAJOR) && (IDE_VERSION_MAJOR == 3 && IDE_VERSION_MINOR == 0)
|
||||||
@@ -100,17 +99,17 @@ Core::Id Project::id() const
|
|||||||
|
|
||||||
Core::IDocument* Project::document() const
|
Core::IDocument* Project::document() const
|
||||||
{
|
{
|
||||||
return projectFile_;
|
return m_projectFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::IProjectManager* Project::projectManager() const
|
ProjectExplorer::IProjectManager* Project::projectManager() const
|
||||||
{
|
{
|
||||||
return manager_;
|
return m_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ProjectNode* Project::rootProjectNode() const
|
ProjectExplorer::ProjectNode* Project::rootProjectNode() const
|
||||||
{
|
{
|
||||||
return projectNode_;
|
return m_projectNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Project::files(FilesMode fileMode) const
|
QStringList Project::files(FilesMode fileMode) const
|
||||||
@@ -118,7 +117,7 @@ QStringList Project::files(FilesMode fileMode) const
|
|||||||
// TODO: handle ExcludeGeneratedFiles, but what files exactly?
|
// TODO: handle ExcludeGeneratedFiles, but what files exactly?
|
||||||
// *.qtcreator.files, *.qtcreator.includes and *.user?
|
// *.qtcreator.files, *.qtcreator.includes and *.user?
|
||||||
Q_UNUSED(fileMode);
|
Q_UNUSED(fileMode);
|
||||||
return files_;
|
return m_files;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Project::files() const
|
QStringList Project::files() const
|
||||||
@@ -128,14 +127,14 @@ QStringList Project::files() const
|
|||||||
|
|
||||||
QString Project::filesFilePath() const
|
QString Project::filesFilePath() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(!filesFilePath_.isEmpty());
|
Q_ASSERT(!m_filesFilePath.isEmpty());
|
||||||
return filesFilePath_;
|
return m_filesFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Project::includesFilePath() const
|
QString Project::includesFilePath() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(!includesFilePath_.isEmpty());
|
Q_ASSERT(!m_includesFilePath.isEmpty());
|
||||||
return includesFilePath_;
|
return m_includesFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Project::needsConfiguration() const
|
bool Project::needsConfiguration() const
|
||||||
@@ -173,9 +172,9 @@ QString Project::defaultWorkingDirectory(QString const& top)
|
|||||||
|
|
||||||
void Project::setProjectName(QString const& name)
|
void Project::setProjectName(QString const& name)
|
||||||
{
|
{
|
||||||
if (projectName_ != name) {
|
if (m_projectName != name) {
|
||||||
projectName_ = name;
|
m_projectName = name;
|
||||||
projectNode_->setDisplayName(projectName_);
|
m_projectNode->setDisplayName(m_projectName);
|
||||||
// TODO: signal?
|
// TODO: signal?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,7 +182,7 @@ void Project::setProjectName(QString const& name)
|
|||||||
QVariantMap Project::toMap() const
|
QVariantMap Project::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map(ProjectExplorer::Project::toMap());
|
QVariantMap map(ProjectExplorer::Project::toMap());
|
||||||
map.insert(QLatin1String(Constants::P_KEY_PROJECTNAME), projectName_);
|
map.insert(QLatin1String(Constants::P_KEY_PROJECTNAME), m_projectName);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,14 +191,14 @@ QVariantMap Project::toMap() const
|
|||||||
bool Project::fromMap(QVariantMap const& map)
|
bool Project::fromMap(QVariantMap const& map)
|
||||||
{
|
{
|
||||||
BBPM_QDEBUG(displayName());
|
BBPM_QDEBUG(displayName());
|
||||||
QTC_ASSERT(projectNode_, return false);
|
QTC_ASSERT(m_projectNode, return false);
|
||||||
|
|
||||||
if (!ProjectExplorer::Project::fromMap(map))
|
if (!ProjectExplorer::Project::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QVariantMap extraValues(map);
|
QVariantMap extraValues(map);
|
||||||
if (!extraValues.contains(BBPM_C(P_KEY_PROJECTNAME)))
|
if (!extraValues.contains(BBPM_C(P_KEY_PROJECTNAME)))
|
||||||
extraValues.insert(BBPM_C(P_KEY_PROJECTNAME), projectName_);
|
extraValues.insert(BBPM_C(P_KEY_PROJECTNAME), m_projectName);
|
||||||
setProjectName(map.value(BBPM_C(P_KEY_PROJECTNAME)).toString());
|
setProjectName(map.value(BBPM_C(P_KEY_PROJECTNAME)).toString());
|
||||||
|
|
||||||
// Check required auxiliary files, run wizard of necessary
|
// Check required auxiliary files, run wizard of necessary
|
||||||
@@ -264,14 +263,14 @@ void Project::refresh()
|
|||||||
QTC_ASSERT(QFileInfo(includesFilePath()).exists(), return);
|
QTC_ASSERT(QFileInfo(includesFilePath()).exists(), return);
|
||||||
|
|
||||||
QSet<QString> oldFileList;
|
QSet<QString> oldFileList;
|
||||||
oldFileList = files_.toSet();
|
oldFileList = m_files.toSet();
|
||||||
|
|
||||||
// Parse project:
|
// Parse project:
|
||||||
// The manager does not parse Jamfile files.
|
// The manager does not parse Jamfile files.
|
||||||
// Only generates and parses list of source files in Jamfile.${JAMFILE_FILES_EXT}
|
// Only generates and parses list of source files in Jamfile.${JAMFILE_FILES_EXT}
|
||||||
QString const projectPath(projectDirectory().toString());
|
QString const projectPath(projectDirectory().toString());
|
||||||
filesRaw_ = Utility::readLines(filesFilePath());
|
m_filesRaw = Utility::readLines(filesFilePath());
|
||||||
files_ = Utility::makeAbsolutePaths(projectPath, filesRaw_);
|
m_files = Utility::makeAbsolutePaths(projectPath, m_filesRaw);
|
||||||
|
|
||||||
QStringList includePaths =
|
QStringList includePaths =
|
||||||
Utility::makeAbsolutePaths(projectPath,
|
Utility::makeAbsolutePaths(projectPath,
|
||||||
@@ -279,7 +278,7 @@ void Project::refresh()
|
|||||||
|
|
||||||
emit fileListChanged();
|
emit fileListChanged();
|
||||||
|
|
||||||
projectNode_->refresh(oldFileList);
|
m_projectNode->refresh(oldFileList);
|
||||||
|
|
||||||
// TODO: Does it make sense to move this to separate asynchronous task?
|
// TODO: Does it make sense to move this to separate asynchronous task?
|
||||||
// TODO: extract updateCppCodeModel
|
// TODO: extract updateCppCodeModel
|
||||||
@@ -292,13 +291,13 @@ void Project::refresh()
|
|||||||
//builder.setDefines(); // TODO: waiting for Jamfile parser
|
//builder.setDefines(); // TODO: waiting for Jamfile parser
|
||||||
builder.setIncludePaths(QStringList() << projectDirectory().toString() << includePaths);
|
builder.setIncludePaths(QStringList() << projectDirectory().toString() << includePaths);
|
||||||
|
|
||||||
const QList<Core::Id> languages = builder.createProjectPartsForFiles(files_);
|
const QList<Core::Id> languages = builder.createProjectPartsForFiles(m_files);
|
||||||
foreach (Core::Id language, languages)
|
foreach (Core::Id language, languages)
|
||||||
setProjectLanguage(language, true);
|
setProjectLanguage(language, true);
|
||||||
|
|
||||||
cppModelFuture_.cancel();
|
m_cppModelFuture.cancel();
|
||||||
pinfo.finish();
|
pinfo.finish();
|
||||||
cppModelFuture_ = modelmanager->updateProjectInfo(pinfo);
|
m_cppModelFuture = modelmanager->updateProjectInfo(pinfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,15 +12,12 @@
|
|||||||
#ifndef BBPROJECT_HPP
|
#ifndef BBPROJECT_HPP
|
||||||
#define BBPROJECT_HPP
|
#define BBPROJECT_HPP
|
||||||
|
|
||||||
// Qt Creator
|
|
||||||
#include <app/app_version.h>
|
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
// Qt
|
|
||||||
#include <QString>
|
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
#include <QFutureInterface>
|
#include <QString>
|
||||||
|
|
||||||
namespace BoostBuildProjectManager {
|
namespace BoostBuildProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -38,9 +35,6 @@ public:
|
|||||||
Project(ProjectManager* manager, QString const& fileName);
|
Project(ProjectManager* manager, QString const& fileName);
|
||||||
~Project();
|
~Project();
|
||||||
|
|
||||||
#if defined(IDE_VERSION_MAJOR) && (IDE_VERSION_MAJOR == 3 && IDE_VERSION_MINOR == 0)
|
|
||||||
Core::Id id() const;
|
|
||||||
#endif
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
Core::IDocument* document() const;
|
Core::IDocument* document() const;
|
||||||
ProjectExplorer::IProjectManager* projectManager() const;
|
ProjectExplorer::IProjectManager* projectManager() const;
|
||||||
@@ -61,43 +55,38 @@ public:
|
|||||||
static QString defaultWorkingDirectory(QString const& top);
|
static QString defaultWorkingDirectory(QString const& top);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
// Deserializes all project data from the map object
|
|
||||||
// Calls the base ProjectExplorer::Project::fromMap function first.
|
|
||||||
bool fromMap(QVariantMap const& map);
|
bool fromMap(QVariantMap const& map);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void setProjectName(QString const& name);
|
void setProjectName(QString const& name);
|
||||||
|
|
||||||
// Corresponding project manager passed to the constructor
|
// Corresponding project manager passed to the constructor
|
||||||
ProjectManager* manager_;
|
ProjectManager *m_manager;
|
||||||
|
|
||||||
// By default, name of directory with Jamfile.
|
// By default, name of directory with Jamfile.
|
||||||
// Boost.Build treats each Jamfile is a separate project,
|
// Boost.Build treats each Jamfile is a separate project,
|
||||||
// where hierarchy of Jamfiles makes hierarchy of projects.
|
// where hierarchy of Jamfiles makes hierarchy of projects.
|
||||||
QString projectName_;
|
QString m_projectName;
|
||||||
|
|
||||||
// Jamfile passed to the constructor (Jamroot, Jamfile, Jamfile.v2).
|
// Jamfile passed to the constructor (Jamroot, Jamfile, Jamfile.v2).
|
||||||
QString filePath_;
|
QString m_filePath;
|
||||||
|
|
||||||
// Auxiliary file Jamfile.${JAMFILE_FILES_EXT} with list of source files.
|
// Auxiliary file Jamfile.${JAMFILE_FILES_EXT} with list of source files.
|
||||||
// Role of this file is similar to the .files file in the GenericProjectManager,
|
// Role of this file is similar to the .files file in the GenericProjectManager,
|
||||||
// hence managing of this file is implemented in very similar manner.
|
// hence managing of this file is implemented in very similar manner.
|
||||||
QString filesFilePath_;
|
QString m_filesFilePath;
|
||||||
QStringList files_;
|
QStringList m_files;
|
||||||
QStringList filesRaw_;
|
QStringList m_filesRaw;
|
||||||
QHash<QString, QString> entriesRaw_;
|
QHash<QString, QString> m_entriesRaw;
|
||||||
|
|
||||||
// Auxiliary file Jamfile.${JAMFILE_INCLUDES_EXT} with list of source files.
|
// Auxiliary file Jamfile.${JAMFILE_INCLUDES_EXT} with list of source files.
|
||||||
QString includesFilePath_;
|
QString m_includesFilePath;
|
||||||
|
|
||||||
ProjectFile* projectFile_;
|
ProjectFile *m_projectFile;
|
||||||
ProjectNode* projectNode_;
|
ProjectNode *m_projectNode;
|
||||||
|
|
||||||
QFuture<void> cppModelFuture_;
|
QFuture<void> m_cppModelFuture;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -19,7 +19,7 @@ namespace Internal {
|
|||||||
|
|
||||||
ProjectFile::ProjectFile(Project* project, QString const& fileName)
|
ProjectFile::ProjectFile(Project* project, QString const& fileName)
|
||||||
: Core::IDocument(project)
|
: Core::IDocument(project)
|
||||||
, project_(project)
|
, m_project(project)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!fileName.isEmpty());
|
Q_ASSERT(!fileName.isEmpty());
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public:
|
|||||||
bool reload(QString* errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString* errorString, ReloadFlag flag, ChangeType type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Project* project_;
|
Project *m_project;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -13,9 +13,9 @@
|
|||||||
#include "b2projectmanagerconstants.h"
|
#include "b2projectmanagerconstants.h"
|
||||||
#include "b2project.h"
|
#include "b2project.h"
|
||||||
#include "b2utility.h"
|
#include "b2utility.h"
|
||||||
// Qt Creator
|
|
||||||
#include <projectexplorer/iprojectmanager.h>
|
#include <projectexplorer/iprojectmanager.h>
|
||||||
// Qt
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
@@ -51,13 +51,13 @@ ProjectManager::openProject(QString const& fileName, QString* errorString)
|
|||||||
void ProjectManager::registerProject(Project* project)
|
void ProjectManager::registerProject(Project* project)
|
||||||
{
|
{
|
||||||
Q_ASSERT(project);
|
Q_ASSERT(project);
|
||||||
projects_.append(project);
|
m_projects.append(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectManager::unregisterProject(Project* project)
|
void ProjectManager::unregisterProject(Project* project)
|
||||||
{
|
{
|
||||||
Q_ASSERT(project);
|
Q_ASSERT(project);
|
||||||
projects_.removeAll(project);
|
m_projects.removeAll(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -12,15 +12,12 @@
|
|||||||
#ifndef BBPROJECTMANAGER_HPP
|
#ifndef BBPROJECTMANAGER_HPP
|
||||||
#define BBPROJECTMANAGER_HPP
|
#define BBPROJECTMANAGER_HPP
|
||||||
|
|
||||||
// Qt Creator
|
|
||||||
#include <projectexplorer/iprojectmanager.h>
|
#include <projectexplorer/iprojectmanager.h>
|
||||||
// Qt
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer { class Project; }
|
||||||
class Project;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace BoostBuildProjectManager {
|
namespace BoostBuildProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -45,7 +42,7 @@ public:
|
|||||||
void unregisterProject(Project* project);
|
void unregisterProject(Project* project);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<Project*> projects_;
|
QList<Project*> m_projects;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
// Qt
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
|
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
namespace BoostBuildProjectManager { namespace Internal {
|
namespace BoostBuildProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
BoostBuildPlugin::BoostBuildPlugin()
|
BoostBuildPlugin::BoostBuildPlugin()
|
||||||
{
|
{
|
||||||
@@ -80,4 +81,5 @@ ExtensionSystem::IPlugin::ShutdownFlag BoostBuildPlugin::aboutToShutdown()
|
|||||||
return SynchronousShutdown;
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
} // namespace Internal
|
||||||
|
} // namespace BoostBuildProjectManager
|
||||||
|
@@ -13,11 +13,11 @@
|
|||||||
#include "b2projectnode.h"
|
#include "b2projectnode.h"
|
||||||
#include "b2project.h"
|
#include "b2project.h"
|
||||||
#include "b2utility.h"
|
#include "b2utility.h"
|
||||||
// Qt Creator
|
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
// Qt
|
|
||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -30,8 +30,8 @@ namespace Internal {
|
|||||||
|
|
||||||
ProjectNode::ProjectNode(Project* project, Core::IDocument* projectFile)
|
ProjectNode::ProjectNode(Project* project, Core::IDocument* projectFile)
|
||||||
: ProjectExplorer::ProjectNode(projectFile->filePath())
|
: ProjectExplorer::ProjectNode(projectFile->filePath())
|
||||||
, project_(project)
|
, m_project(project)
|
||||||
, projectFile_(projectFile)
|
, m_projectFile(projectFile)
|
||||||
{
|
{
|
||||||
// TODO: setDisplayName(QFileInfo(projectFile->filePath()).completeBaseName());
|
// TODO: setDisplayName(QFileInfo(projectFile->filePath()).completeBaseName());
|
||||||
}
|
}
|
||||||
@@ -108,15 +108,15 @@ void ProjectNode::refresh(QSet<QString> oldFileList)
|
|||||||
// Only do this once, at first run.
|
// Only do this once, at first run.
|
||||||
if (oldFileList.isEmpty()) {
|
if (oldFileList.isEmpty()) {
|
||||||
using ProjectExplorer::FileNode;
|
using ProjectExplorer::FileNode;
|
||||||
FileNode* projectFileNode = new FileNode(project_->projectFilePath()
|
FileNode* projectFileNode = new FileNode(m_project->projectFilePath()
|
||||||
, ProjectExplorer::ProjectFileType
|
, ProjectExplorer::ProjectFileType
|
||||||
, Constants::FileNotGenerated);
|
, Constants::FileNotGenerated);
|
||||||
|
|
||||||
FileNode* filesFileNode = new FileNode(Utils::FileName::fromString(project_->filesFilePath())
|
FileNode* filesFileNode = new FileNode(Utils::FileName::fromString(m_project->filesFilePath())
|
||||||
, ProjectExplorer::ProjectFileType
|
, ProjectExplorer::ProjectFileType
|
||||||
, Constants::FileNotGenerated);
|
, Constants::FileNotGenerated);
|
||||||
|
|
||||||
FileNode* includesFileNode = new FileNode(Utils::FileName::fromString(project_->includesFilePath())
|
FileNode* includesFileNode = new FileNode(Utils::FileName::fromString(m_project->includesFilePath())
|
||||||
, ProjectExplorer::ProjectFileType
|
, ProjectExplorer::ProjectFileType
|
||||||
, Constants::FileNotGenerated);
|
, Constants::FileNotGenerated);
|
||||||
|
|
||||||
@@ -124,12 +124,12 @@ void ProjectNode::refresh(QSet<QString> oldFileList)
|
|||||||
<< projectFileNode << filesFileNode << includesFileNode);
|
<< projectFileNode << filesFileNode << includesFileNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
oldFileList.remove(project_->filesFilePath());
|
oldFileList.remove(m_project->filesFilePath());
|
||||||
oldFileList.remove(project_->includesFilePath());
|
oldFileList.remove(m_project->includesFilePath());
|
||||||
|
|
||||||
QSet<QString> newFileList = project_->files().toSet();
|
QSet<QString> newFileList = m_project->files().toSet();
|
||||||
newFileList.remove(project_->filesFilePath());
|
newFileList.remove(m_project->filesFilePath());
|
||||||
newFileList.remove(project_->includesFilePath());
|
newFileList.remove(m_project->includesFilePath());
|
||||||
|
|
||||||
// Calculate set of added and removed files
|
// Calculate set of added and removed files
|
||||||
QSet<QString> removed = oldFileList;
|
QSet<QString> removed = oldFileList;
|
||||||
|
@@ -13,22 +13,17 @@
|
|||||||
#ifndef BBPROJECTNODE_HPP
|
#ifndef BBPROJECTNODE_HPP
|
||||||
#define BBPROJECTNODE_HPP
|
#define BBPROJECTNODE_HPP
|
||||||
|
|
||||||
// Qt Creator
|
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
// Qt
|
|
||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core { class IDocument; }
|
||||||
class IDocument;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer { class RunConfiguration; }
|
||||||
class RunConfiguration;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace BoostBuildProjectManager {
|
namespace BoostBuildProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -40,7 +35,6 @@ class Project;
|
|||||||
// No special operations (addFiles(), removeFiles(), renameFile(), etc.) are offered.
|
// No special operations (addFiles(), removeFiles(), renameFile(), etc.) are offered.
|
||||||
class ProjectNode : public ProjectExplorer::ProjectNode
|
class ProjectNode : public ProjectExplorer::ProjectNode
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProjectNode(Project* project, Core::IDocument* projectFile);
|
ProjectNode(Project* project, Core::IDocument* projectFile);
|
||||||
|
|
||||||
@@ -58,7 +52,6 @@ public:
|
|||||||
void refresh(QSet<QString> oldFileList);
|
void refresh(QSet<QString> oldFileList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ProjectExplorer::FolderNode*
|
ProjectExplorer::FolderNode*
|
||||||
createFolderByName(QStringList const& components, int end);
|
createFolderByName(QStringList const& components, int end);
|
||||||
|
|
||||||
@@ -67,8 +60,8 @@ private:
|
|||||||
|
|
||||||
void removeEmptySubFolders(FolderNode* parent, FolderNode* subParent);
|
void removeEmptySubFolders(FolderNode* parent, FolderNode* subParent);
|
||||||
|
|
||||||
Project* project_;
|
Project *m_project;
|
||||||
Core::IDocument* projectFile_;
|
Core::IDocument *m_projectFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -44,9 +44,7 @@ class QTreeView;
|
|||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils { class PathChooser; }
|
||||||
class PathChooser;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace BoostBuildProjectManager {
|
namespace BoostBuildProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -91,8 +89,8 @@ private:
|
|||||||
|
|
||||||
QPushButton *m_applyFilterButton;
|
QPushButton *m_applyFilterButton;
|
||||||
|
|
||||||
QLabel* m_baseDirLabel;
|
QLabel *m_baseDirLabel;
|
||||||
Utils::PathChooser* m_baseDirChooser;
|
Utils::PathChooser *m_baseDirChooser;
|
||||||
QString m_lastBaseDir;
|
QString m_lastBaseDir;
|
||||||
|
|
||||||
QTreeView *m_view;
|
QTreeView *m_view;
|
||||||
|
Reference in New Issue
Block a user