forked from qt-creator/qt-creator
Class name simplification for MakeStep related classes
Was a bit confusing that a MakeStep was constructed by a MakeBuildStepFactory and configured by a MakeBuildStepConfigWidget. The MakeStep of the generic project manager was renamed to GenericMakeStep.
This commit is contained in:
@@ -57,7 +57,7 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
|
|||||||
CMakeSettingsPage *cmp = new CMakeSettingsPage();
|
CMakeSettingsPage *cmp = new CMakeSettingsPage();
|
||||||
addAutoReleasedObject(cmp);
|
addAutoReleasedObject(cmp);
|
||||||
addAutoReleasedObject(new CMakeManager(cmp));
|
addAutoReleasedObject(new CMakeManager(cmp));
|
||||||
addAutoReleasedObject(new MakeBuildStepFactory());
|
addAutoReleasedObject(new MakeStepFactory());
|
||||||
addAutoReleasedObject(new CMakeRunConfigurationFactory());
|
addAutoReleasedObject(new CMakeRunConfigurationFactory());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,10 @@
|
|||||||
#include "makestep.h"
|
#include "makestep.h"
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
#include "cmakeproject.h"
|
#include "cmakeproject.h"
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
#include <QtGui/QGroupBox>
|
#include <QtGui/QGroupBox>
|
||||||
#include <QtGui/QCheckBox>
|
#include <QtGui/QCheckBox>
|
||||||
@@ -43,7 +44,6 @@ namespace {
|
|||||||
bool debug = false;
|
bool debug = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
using namespace CMakeProjectManager;
|
using namespace CMakeProjectManager;
|
||||||
using namespace CMakeProjectManager::Internal;
|
using namespace CMakeProjectManager::Internal;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ QString MakeStep::displayName()
|
|||||||
|
|
||||||
ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget()
|
ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget()
|
||||||
{
|
{
|
||||||
return new MakeBuildStepConfigWidget(this);
|
return new MakeStepConfigWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::immutable() const
|
bool MakeStep::immutable() const
|
||||||
@@ -233,10 +233,10 @@ void MakeStep::setAdditionalArguments(const QString &buildConfiguration, const Q
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// CMakeBuildStepConfigWidget
|
// MakeStepConfigWidget
|
||||||
//
|
//
|
||||||
|
|
||||||
MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep)
|
MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
||||||
: m_makeStep(makeStep)
|
: m_makeStep(makeStep)
|
||||||
{
|
{
|
||||||
QFormLayout *fl = new QFormLayout(this);
|
QFormLayout *fl = new QFormLayout(this);
|
||||||
@@ -261,22 +261,22 @@ MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep)
|
|||||||
connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeBuildStepConfigWidget::additionalArgumentsEdited()
|
void MakeStepConfigWidget::additionalArgumentsEdited()
|
||||||
{
|
{
|
||||||
m_makeStep->setAdditionalArguments(m_buildConfiguration, ProjectExplorer::Environment::parseCombinedArgString(m_additionalArguments->text()));
|
m_makeStep->setAdditionalArguments(m_buildConfiguration, ProjectExplorer::Environment::parseCombinedArgString(m_additionalArguments->text()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeBuildStepConfigWidget::itemChanged(QListWidgetItem *item)
|
void MakeStepConfigWidget::itemChanged(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked);
|
m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeBuildStepConfigWidget::displayName() const
|
QString MakeStepConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return "Make";
|
return "Make";
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeBuildStepConfigWidget::init(const QString &buildConfiguration)
|
void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
||||||
{
|
{
|
||||||
// disconnect to make the changes to the items
|
// disconnect to make the changes to the items
|
||||||
disconnect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
disconnect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
||||||
@@ -293,15 +293,15 @@ void MakeBuildStepConfigWidget::init(const QString &buildConfiguration)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// MakeBuildStepFactory
|
// MakeStepFactory
|
||||||
//
|
//
|
||||||
|
|
||||||
bool MakeBuildStepFactory::canCreate(const QString &name) const
|
bool MakeStepFactory::canCreate(const QString &name) const
|
||||||
{
|
{
|
||||||
return (Constants::MAKESTEP == name);
|
return (Constants::MAKESTEP == name);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
|
ProjectExplorer::BuildStep *MakeStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(name == Constants::MAKESTEP);
|
Q_ASSERT(name == Constants::MAKESTEP);
|
||||||
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||||
@@ -309,12 +309,12 @@ ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Projec
|
|||||||
return new MakeStep(pro);
|
return new MakeStep(pro);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList MakeBuildStepFactory::canCreateForProject(ProjectExplorer::Project * /* pro */) const
|
QStringList MakeStepFactory::canCreateForProject(ProjectExplorer::Project * /* pro */) const
|
||||||
{
|
{
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeBuildStepFactory::displayNameForName(const QString & /* name */) const
|
QString MakeStepFactory::displayNameForName(const QString & /* name */) const
|
||||||
{
|
{
|
||||||
return "Make";
|
return "Make";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ private:
|
|||||||
QSet<QString> m_openDirectories;
|
QSet<QString> m_openDirectories;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MakeBuildStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
class MakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MakeBuildStepConfigWidget(MakeStep *makeStep);
|
MakeStepConfigWidget(MakeStep *makeStep);
|
||||||
virtual QString displayName() const;
|
virtual QString displayName() const;
|
||||||
virtual void init(const QString &buildConfiguration);
|
virtual void init(const QString &buildConfiguration);
|
||||||
private slots:
|
private slots:
|
||||||
@@ -92,7 +92,7 @@ private:
|
|||||||
QLineEdit *m_additionalArguments;
|
QLineEdit *m_additionalArguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||||
{
|
{
|
||||||
virtual bool canCreate(const QString &name) const;
|
virtual bool canCreate(const QString &name) const;
|
||||||
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, const QString &name) const;
|
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, const QString &name) const;
|
||||||
@@ -100,7 +100,7 @@ class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
|||||||
virtual QString displayNameForName(const QString &name) const;
|
virtual QString displayNameForName(const QString &name) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace CMakeProjectManager
|
||||||
|
|
||||||
#endif // MAKESTEP_H
|
#endif // MAKESTEP_H
|
||||||
|
|||||||
@@ -27,12 +27,13 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "makestep.h"
|
#include "genericmakestep.h"
|
||||||
#include "genericprojectconstants.h"
|
#include "genericprojectconstants.h"
|
||||||
#include "genericproject.h"
|
#include "genericproject.h"
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
#include <QtGui/QGroupBox>
|
#include <QtGui/QGroupBox>
|
||||||
#include <QtGui/QCheckBox>
|
#include <QtGui/QCheckBox>
|
||||||
@@ -43,22 +44,21 @@ namespace {
|
|||||||
bool debug = false;
|
bool debug = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
using namespace GenericProjectManager;
|
using namespace GenericProjectManager;
|
||||||
using namespace GenericProjectManager::Internal;
|
using namespace GenericProjectManager::Internal;
|
||||||
|
|
||||||
MakeStep::MakeStep(GenericProject *pro)
|
GenericMakeStep::GenericMakeStep(GenericProject *pro)
|
||||||
: AbstractProcessStep(pro), m_pro(pro), m_buildParser(0)
|
: AbstractProcessStep(pro), m_pro(pro), m_buildParser(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStep::~MakeStep()
|
GenericMakeStep::~GenericMakeStep()
|
||||||
{
|
{
|
||||||
delete m_buildParser;
|
delete m_buildParser;
|
||||||
m_buildParser = 0;
|
m_buildParser = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::init(const QString &buildConfiguration)
|
bool GenericMakeStep::init(const QString &buildConfiguration)
|
||||||
{
|
{
|
||||||
// TODO figure out the correct build parser
|
// TODO figure out the correct build parser
|
||||||
delete m_buildParser;
|
delete m_buildParser;
|
||||||
@@ -107,46 +107,46 @@ bool MakeStep::init(const QString &buildConfiguration)
|
|||||||
return AbstractProcessStep::init(buildConfiguration);
|
return AbstractProcessStep::init(buildConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::run(QFutureInterface<bool> &fi)
|
void GenericMakeStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
AbstractProcessStep::run(fi);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeStep::name()
|
QString GenericMakeStep::name()
|
||||||
{
|
{
|
||||||
return Constants::MAKESTEP;
|
return Constants::MAKESTEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeStep::displayName()
|
QString GenericMakeStep::displayName()
|
||||||
{
|
{
|
||||||
return "Make";
|
return "Make";
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget()
|
ProjectExplorer::BuildStepConfigWidget *GenericMakeStep::createConfigWidget()
|
||||||
{
|
{
|
||||||
return new MakeBuildStepConfigWidget(this);
|
return new GenericMakeStepConfigWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::immutable() const
|
bool GenericMakeStep::immutable() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::stdOut(const QString &line)
|
void GenericMakeStep::stdOut(const QString &line)
|
||||||
{
|
{
|
||||||
if (m_buildParser)
|
if (m_buildParser)
|
||||||
m_buildParser->stdOutput(line);
|
m_buildParser->stdOutput(line);
|
||||||
AbstractProcessStep::stdOut(line);
|
AbstractProcessStep::stdOut(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::stdError(const QString &line)
|
void GenericMakeStep::stdError(const QString &line)
|
||||||
{
|
{
|
||||||
if (m_buildParser)
|
if (m_buildParser)
|
||||||
m_buildParser->stdError(line);
|
m_buildParser->stdError(line);
|
||||||
AbstractProcessStep::stdError(line);
|
AbstractProcessStep::stdError(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description)
|
void GenericMakeStep::slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description)
|
||||||
{
|
{
|
||||||
QString filePath = fn;
|
QString filePath = fn;
|
||||||
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
|
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
|
||||||
@@ -192,30 +192,30 @@ void MakeStep::slotAddToTaskWindow(const QString & fn, int type, int linenumber,
|
|||||||
emit addToTaskWindow(filePath, type, linenumber, description);
|
emit addToTaskWindow(filePath, type, linenumber, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::addDirectory(const QString &dir)
|
void GenericMakeStep::addDirectory(const QString &dir)
|
||||||
{
|
{
|
||||||
if (!m_openDirectories.contains(dir))
|
if (!m_openDirectories.contains(dir))
|
||||||
m_openDirectories.insert(dir);
|
m_openDirectories.insert(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::removeDirectory(const QString &dir)
|
void GenericMakeStep::removeDirectory(const QString &dir)
|
||||||
{
|
{
|
||||||
if (m_openDirectories.contains(dir))
|
if (m_openDirectories.contains(dir))
|
||||||
m_openDirectories.remove(dir);
|
m_openDirectories.remove(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GenericProject *MakeStep::project() const
|
GenericProject *GenericMakeStep::project() const
|
||||||
{
|
{
|
||||||
return m_pro;
|
return m_pro;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::buildsTarget(const QString &buildConfiguration, const QString &target) const
|
bool GenericMakeStep::buildsTarget(const QString &buildConfiguration, const QString &target) const
|
||||||
{
|
{
|
||||||
return value(buildConfiguration, "buildTargets").toStringList().contains(target);
|
return value(buildConfiguration, "buildTargets").toStringList().contains(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::setBuildTarget(const QString &buildConfiguration, const QString &target, bool on)
|
void GenericMakeStep::setBuildTarget(const QString &buildConfiguration, const QString &target, bool on)
|
||||||
{
|
{
|
||||||
QStringList old = value(buildConfiguration, "buildTargets").toStringList();
|
QStringList old = value(buildConfiguration, "buildTargets").toStringList();
|
||||||
if (on && !old.contains(target))
|
if (on && !old.contains(target))
|
||||||
@@ -225,9 +225,10 @@ void MakeStep::setBuildTarget(const QString &buildConfiguration, const QString &
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// GenericBuildStepConfigWidget
|
// GenericMakeStepConfigWidget
|
||||||
//
|
//
|
||||||
MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep)
|
|
||||||
|
GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeStep)
|
||||||
: m_makeStep(makeStep)
|
: m_makeStep(makeStep)
|
||||||
{
|
{
|
||||||
QFormLayout *fl = new QFormLayout(this);
|
QFormLayout *fl = new QFormLayout(this);
|
||||||
@@ -246,17 +247,17 @@ MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep)
|
|||||||
connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeBuildStepConfigWidget::itemChanged(QListWidgetItem *item)
|
void GenericMakeStepConfigWidget::itemChanged(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked);
|
m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeBuildStepConfigWidget::displayName() const
|
QString GenericMakeStepConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return "Make";
|
return "Make";
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeBuildStepConfigWidget::init(const QString &buildConfiguration)
|
void GenericMakeStepConfigWidget::init(const QString &buildConfiguration)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
@@ -273,29 +274,28 @@ void MakeBuildStepConfigWidget::init(const QString &buildConfiguration)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// MakeBuildStepFactory
|
// GenericMakeStepFactory
|
||||||
//
|
//
|
||||||
|
|
||||||
bool MakeBuildStepFactory::canCreate(const QString &name) const
|
bool GenericMakeStepFactory::canCreate(const QString &name) const
|
||||||
{
|
{
|
||||||
return (Constants::MAKESTEP == name);
|
return (Constants::MAKESTEP == name);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
|
ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(name == Constants::MAKESTEP);
|
Q_ASSERT(name == Constants::MAKESTEP);
|
||||||
GenericProject *pro = qobject_cast<GenericProject *>(project);
|
GenericProject *pro = qobject_cast<GenericProject *>(project);
|
||||||
Q_ASSERT(pro);
|
Q_ASSERT(pro);
|
||||||
return new MakeStep(pro);
|
return new GenericMakeStep(pro);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList MakeBuildStepFactory::canCreateForProject(ProjectExplorer::Project * /* pro */) const
|
QStringList GenericMakeStepFactory::canCreateForProject(ProjectExplorer::Project * /* pro */) const
|
||||||
{
|
{
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeBuildStepFactory::displayNameForName(const QString & /* name */) const
|
QString GenericMakeStepFactory::displayNameForName(const QString & /* name */) const
|
||||||
{
|
{
|
||||||
return "Make";
|
return "Make";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,12 +43,12 @@ namespace Internal {
|
|||||||
|
|
||||||
class GenericProject;
|
class GenericProject;
|
||||||
|
|
||||||
class MakeStep : public ProjectExplorer::AbstractProcessStep
|
class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MakeStep(GenericProject *pro);
|
GenericMakeStep(GenericProject *pro);
|
||||||
~MakeStep();
|
~GenericMakeStep();
|
||||||
virtual bool init(const QString &buildConfiguration);
|
virtual bool init(const QString &buildConfiguration);
|
||||||
|
|
||||||
virtual void run(QFutureInterface<bool> &fi);
|
virtual void run(QFutureInterface<bool> &fi);
|
||||||
@@ -73,22 +73,22 @@ private:
|
|||||||
QSet<QString> m_openDirectories;
|
QSet<QString> m_openDirectories;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MakeBuildStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
class GenericMakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MakeBuildStepConfigWidget(MakeStep *makeStep);
|
GenericMakeStepConfigWidget(GenericMakeStep *makeStep);
|
||||||
virtual QString displayName() const;
|
virtual QString displayName() const;
|
||||||
virtual void init(const QString &buildConfiguration);
|
virtual void init(const QString &buildConfiguration);
|
||||||
private slots:
|
private slots:
|
||||||
void itemChanged(QListWidgetItem*);
|
void itemChanged(QListWidgetItem*);
|
||||||
private:
|
private:
|
||||||
QString m_buildConfiguration;
|
QString m_buildConfiguration;
|
||||||
MakeStep * m_makeStep;
|
GenericMakeStep *m_makeStep;
|
||||||
QListWidget *m_targetsList;
|
QListWidget *m_targetsList;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
class GenericMakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||||
{
|
{
|
||||||
virtual bool canCreate(const QString &name) const;
|
virtual bool canCreate(const QString &name) const;
|
||||||
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, const QString &name) const;
|
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, const QString &name) const;
|
||||||
@@ -29,17 +29,15 @@
|
|||||||
|
|
||||||
#include "genericproject.h"
|
#include "genericproject.h"
|
||||||
#include "genericprojectconstants.h"
|
#include "genericprojectconstants.h"
|
||||||
#include "genericprojectnodes.h"
|
#include "genericmakestep.h"
|
||||||
#include "makestep.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
#include <cpptools/cppmodelmanagerinterface.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
|
||||||
|
|
||||||
#include <QtCore/QtDebug>
|
#include <QtCore/QtDebug>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
@@ -55,10 +53,6 @@
|
|||||||
using namespace GenericProjectManager;
|
using namespace GenericProjectManager;
|
||||||
using namespace GenericProjectManager::Internal;
|
using namespace GenericProjectManager::Internal;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// GenericProject
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class ListModel: public QStringListModel
|
class ListModel: public QStringListModel
|
||||||
@@ -104,6 +98,10 @@ public:
|
|||||||
|
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GenericProject
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GenericProject::GenericProject(Manager *manager, const QString &fileName)
|
GenericProject::GenericProject(Manager *manager, const QString &fileName)
|
||||||
: m_manager(manager),
|
: m_manager(manager),
|
||||||
m_fileName(fileName),
|
m_fileName(fileName),
|
||||||
@@ -401,10 +399,10 @@ QStringList GenericProject::targets() const
|
|||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStep *GenericProject::makeStep() const
|
GenericMakeStep *GenericProject::makeStep() const
|
||||||
{
|
{
|
||||||
foreach (ProjectExplorer::BuildStep *bs, buildSteps()) {
|
foreach (ProjectExplorer::BuildStep *bs, buildSteps()) {
|
||||||
if (MakeStep *ms = qobject_cast<MakeStep *>(bs))
|
if (GenericMakeStep *ms = qobject_cast<GenericMakeStep *>(bs))
|
||||||
return ms;
|
return ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +414,7 @@ void GenericProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsRead
|
|||||||
Project::restoreSettingsImpl(reader);
|
Project::restoreSettingsImpl(reader);
|
||||||
|
|
||||||
if (buildConfigurations().isEmpty()) {
|
if (buildConfigurations().isEmpty()) {
|
||||||
MakeStep *makeStep = new MakeStep(this);
|
GenericMakeStep *makeStep = new GenericMakeStep(this);
|
||||||
insertBuildStep(0, makeStep);
|
insertBuildStep(0, makeStep);
|
||||||
|
|
||||||
const QLatin1String all("all");
|
const QLatin1String all("all");
|
||||||
@@ -457,6 +455,7 @@ void GenericProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter
|
|||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
// GenericBuildSettingsWidget
|
// GenericBuildSettingsWidget
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
|
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
|
||||||
: m_project(project)
|
: m_project(project)
|
||||||
{
|
{
|
||||||
@@ -496,6 +495,7 @@ void GenericBuildSettingsWidget::buildDirectoryChanged()
|
|||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
// GenericProjectFile
|
// GenericProjectFile
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GenericProjectFile::GenericProjectFile(GenericProject *parent, QString fileName)
|
GenericProjectFile::GenericProjectFile(GenericProject *parent, QString fileName)
|
||||||
: Core::IFile(parent),
|
: Core::IFile(parent),
|
||||||
m_project(parent),
|
m_project(parent),
|
||||||
|
|||||||
@@ -32,23 +32,28 @@
|
|||||||
|
|
||||||
#include "genericprojectmanager.h"
|
#include "genericprojectmanager.h"
|
||||||
#include "genericprojectnodes.h"
|
#include "genericprojectnodes.h"
|
||||||
#include "makestep.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
#include <utils/pathchooser.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QStringListModel;
|
class QStringListModel;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
namespace Utils {
|
||||||
|
class PathChooser;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace GenericProjectManager {
|
namespace GenericProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class GenericMakeStep;
|
||||||
class GenericProjectFile;
|
class GenericProjectFile;
|
||||||
|
|
||||||
class GenericProject : public ProjectExplorer::Project
|
class GenericProject : public ProjectExplorer::Project
|
||||||
@@ -82,7 +87,7 @@ public:
|
|||||||
virtual QStringList files(FilesMode fileMode) const;
|
virtual QStringList files(FilesMode fileMode) const;
|
||||||
|
|
||||||
QStringList targets() const;
|
QStringList targets() const;
|
||||||
MakeStep *makeStep() const;
|
GenericMakeStep *makeStep() const;
|
||||||
QString buildParser(const QString &buildConfiguration) const;
|
QString buildParser(const QString &buildConfiguration) const;
|
||||||
|
|
||||||
QStringList convertToAbsoluteFiles(const QStringList &paths) const;
|
QStringList convertToAbsoluteFiles(const QStringList &paths) const;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ HEADERS = genericproject.h \
|
|||||||
genericprojectwizard.h \
|
genericprojectwizard.h \
|
||||||
genericprojectfileseditor.h \
|
genericprojectfileseditor.h \
|
||||||
pkgconfigtool.h \
|
pkgconfigtool.h \
|
||||||
makestep.h
|
genericmakestep.h
|
||||||
SOURCES = genericproject.cpp \
|
SOURCES = genericproject.cpp \
|
||||||
genericprojectplugin.cpp \
|
genericprojectplugin.cpp \
|
||||||
genericprojectmanager.cpp \
|
genericprojectmanager.cpp \
|
||||||
@@ -18,5 +18,5 @@ SOURCES = genericproject.cpp \
|
|||||||
genericprojectwizard.cpp \
|
genericprojectwizard.cpp \
|
||||||
genericprojectfileseditor.cpp \
|
genericprojectfileseditor.cpp \
|
||||||
pkgconfigtool.cpp \
|
pkgconfigtool.cpp \
|
||||||
makestep.cpp
|
genericmakestep.cpp
|
||||||
RESOURCES += genericproject.qrc
|
RESOURCES += genericproject.qrc
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "genericprojectwizard.h"
|
#include "genericprojectwizard.h"
|
||||||
#include "genericprojectconstants.h"
|
#include "genericprojectconstants.h"
|
||||||
#include "genericprojectfileseditor.h"
|
#include "genericprojectfileseditor.h"
|
||||||
#include "makestep.h"
|
#include "genericmakestep.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
@@ -76,7 +76,7 @@ bool GenericProjectPlugin::initialize(const QStringList &, QString *errorMessage
|
|||||||
addObject(m_projectFilesEditorFactory);
|
addObject(m_projectFilesEditorFactory);
|
||||||
|
|
||||||
addAutoReleasedObject(manager);
|
addAutoReleasedObject(manager);
|
||||||
addAutoReleasedObject(new MakeBuildStepFactory);
|
addAutoReleasedObject(new GenericMakeStepFactory);
|
||||||
addAutoReleasedObject(new GenericProjectWizard);
|
addAutoReleasedObject(new GenericProjectWizard);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -301,7 +301,6 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
|||||||
m_makeStep->value(buildConfiguration, "makeargs").toStringList();
|
m_makeStep->value(buildConfiguration, "makeargs").toStringList();
|
||||||
m_ui.makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments));
|
m_ui.makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStepConfigWidget::makeLineEditTextEdited()
|
void MakeStepConfigWidget::makeLineEditTextEdited()
|
||||||
|
|||||||
Reference in New Issue
Block a user