forked from qt-creator/qt-creator
Refactoring for (Q)MakeBuildStepFactory
Rename (Q)MakeBuildStepFactory to (Q)MakeStepFacotry Move the factories to the same files as (Q)MakeStep Delete the old qmakebuildstepfactory.(h|cpp)
This commit is contained in:
@@ -315,3 +315,38 @@ void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
|
|||||||
m_makeStep->setValue(m_buildConfiguration, "makeargs",
|
m_makeStep->setValue(m_buildConfiguration, "makeargs",
|
||||||
ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text()));
|
ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
// MakeStep
|
||||||
|
///
|
||||||
|
|
||||||
|
MakeStepFactory::MakeStepFactory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MakeStepFactory::~MakeStepFactory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MakeStepFactory::canCreate(const QString & name) const
|
||||||
|
{
|
||||||
|
return (name == Constants::MAKESTEP);
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::BuildStep * MakeStepFactory::create(ProjectExplorer::Project * pro, const QString & name) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(name);
|
||||||
|
return new MakeStep(static_cast<Qt4Project *>(pro));
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList MakeStepFactory::canCreateForProject(ProjectExplorer::Project *pro) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(pro)
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MakeStepFactory::displayNameForName(const QString &name) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(name);
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,8 +36,28 @@
|
|||||||
#include <projectexplorer/abstractprocessstep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
|
||||||
|
namespace ProjectExplorer {
|
||||||
|
class BuildStep;
|
||||||
|
class IBuildStepFactory;
|
||||||
|
class Project;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
|
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MakeStepFactory();
|
||||||
|
virtual ~MakeStepFactory();
|
||||||
|
bool canCreate(const QString & name) const;
|
||||||
|
ProjectExplorer::BuildStep * create(ProjectExplorer::Project * pro, const QString & name) const;
|
||||||
|
QStringList canCreateForProject(ProjectExplorer::Project *pro) const;
|
||||||
|
QString displayNameForName(const QString &name) const;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
|
|
||||||
// NBS move this class to an own plugin? So that there can be a make project at a future time
|
// NBS move this class to an own plugin? So that there can be a make project at a future time
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Qt Software Information (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at qt-sales@nokia.com.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "qmakebuildstepfactory.h"
|
|
||||||
|
|
||||||
#include "qmakestep.h"
|
|
||||||
#include "makestep.h"
|
|
||||||
#include "qt4project.h"
|
|
||||||
#include "qt4projectmanagerconstants.h"
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
|
||||||
using namespace ProjectExplorer;
|
|
||||||
|
|
||||||
QMakeBuildStepFactory::QMakeBuildStepFactory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QMakeBuildStepFactory::~QMakeBuildStepFactory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QMakeBuildStepFactory::canCreate(const QString & name) const
|
|
||||||
{
|
|
||||||
return (name == Constants::QMAKESTEP);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectExplorer::BuildStep * QMakeBuildStepFactory::create(ProjectExplorer::Project * pro, const QString & name) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(name);
|
|
||||||
return new QMakeStep(static_cast<Qt4Project *>(pro));
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList QMakeBuildStepFactory::canCreateForProject(ProjectExplorer::Project *pro) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(pro)
|
|
||||||
return QStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString QMakeBuildStepFactory::displayNameForName(const QString &name) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(name);
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
MakeBuildStepFactory::MakeBuildStepFactory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
MakeBuildStepFactory::~MakeBuildStepFactory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MakeBuildStepFactory::canCreate(const QString & name) const
|
|
||||||
{
|
|
||||||
return (name == Constants::MAKESTEP);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectExplorer::BuildStep * MakeBuildStepFactory::create(ProjectExplorer::Project * pro, const QString & name) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(name);
|
|
||||||
return new MakeStep(static_cast<Qt4Project *>(pro));
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList MakeBuildStepFactory::canCreateForProject(ProjectExplorer::Project *pro) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(pro)
|
|
||||||
return QStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MakeBuildStepFactory::displayNameForName(const QString &name) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(name);
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Qt Software Information (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
||||||
** accordance with the Qt Commercial License Agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
**
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at qt-sales@nokia.com.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef QMAKEBUILDSTEPFACTORY_H
|
|
||||||
#define QMAKEBUILDSTEPFACTORY_H
|
|
||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
|
||||||
class BuildStep;
|
|
||||||
class IBuildStepFactory;
|
|
||||||
class Project;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class QMakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QMakeBuildStepFactory();
|
|
||||||
virtual ~QMakeBuildStepFactory();
|
|
||||||
bool canCreate(const QString & name) const;
|
|
||||||
ProjectExplorer::BuildStep * create(ProjectExplorer::Project * pro, const QString & name) const;
|
|
||||||
QStringList canCreateForProject(ProjectExplorer::Project *pro) const;
|
|
||||||
QString displayNameForName(const QString &name) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
MakeBuildStepFactory();
|
|
||||||
virtual ~MakeBuildStepFactory();
|
|
||||||
bool canCreate(const QString & name) const;
|
|
||||||
ProjectExplorer::BuildStep * create(ProjectExplorer::Project * pro, const QString & name) const;
|
|
||||||
QStringList canCreateForProject(ProjectExplorer::Project *pro) const;
|
|
||||||
QString displayNameForName(const QString &name) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qt4ProjectManager
|
|
||||||
|
|
||||||
#endif // QMAKEBUILDSTEPFACTORY_H
|
|
||||||
@@ -272,3 +272,39 @@ void QMakeStepConfigWidget::init(const QString &buildConfiguration)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////
|
||||||
|
// QMakeStepFactory
|
||||||
|
////
|
||||||
|
|
||||||
|
QMakeStepFactory::QMakeStepFactory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QMakeStepFactory::~QMakeStepFactory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QMakeStepFactory::canCreate(const QString & name) const
|
||||||
|
{
|
||||||
|
return (name == Constants::QMAKESTEP);
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::BuildStep * QMakeStepFactory::create(ProjectExplorer::Project * pro, const QString & name) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(name);
|
||||||
|
return new QMakeStep(static_cast<Qt4Project *>(pro));
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QMakeStepFactory::canCreateForProject(ProjectExplorer::Project *pro) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(pro)
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QMakeStepFactory::displayNameForName(const QString &name) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(name);
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,28 @@
|
|||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
namespace ProjectExplorer {
|
||||||
|
class BuildStep;
|
||||||
|
class IBuildStepFactory;
|
||||||
|
class Project;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
|
class QMakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
QMakeStepFactory();
|
||||||
|
virtual ~QMakeStepFactory();
|
||||||
|
bool canCreate(const QString & name) const;
|
||||||
|
ProjectExplorer::BuildStep * create(ProjectExplorer::Project * pro, const QString & name) const;
|
||||||
|
QStringList canCreateForProject(ProjectExplorer::Project *pro) const;
|
||||||
|
QString displayNameForName(const QString &name) const;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
|
|
||||||
class QMakeStep : public ProjectExplorer::AbstractProcessStep
|
class QMakeStep : public ProjectExplorer::AbstractProcessStep
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ HEADERS = qt4projectmanagerplugin.h \
|
|||||||
qt4projectmanagerconstants.h \
|
qt4projectmanagerconstants.h \
|
||||||
makestep.h \
|
makestep.h \
|
||||||
qmakestep.h \
|
qmakestep.h \
|
||||||
qmakebuildstepfactory.h \
|
|
||||||
deployhelper.h \
|
deployhelper.h \
|
||||||
embeddedpropertiespage.h \
|
embeddedpropertiespage.h \
|
||||||
qt4runconfiguration.h \
|
qt4runconfiguration.h \
|
||||||
@@ -57,7 +56,6 @@ SOURCES = qt4projectmanagerplugin.cpp \
|
|||||||
wizards/qtwizard.cpp \
|
wizards/qtwizard.cpp \
|
||||||
makestep.cpp \
|
makestep.cpp \
|
||||||
qmakestep.cpp \
|
qmakestep.cpp \
|
||||||
qmakebuildstepfactory.cpp \
|
|
||||||
deployhelper.cpp \
|
deployhelper.cpp \
|
||||||
embeddedpropertiespage.cpp \
|
embeddedpropertiespage.cpp \
|
||||||
qt4runconfiguration.cpp \
|
qt4runconfiguration.cpp \
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
|||||||
LibraryWizard *libWizard = new LibraryWizard;
|
LibraryWizard *libWizard = new LibraryWizard;
|
||||||
addAutoReleasedObject(libWizard);
|
addAutoReleasedObject(libWizard);
|
||||||
|
|
||||||
addAutoReleasedObject(new QMakeBuildStepFactory);
|
addAutoReleasedObject(new QMakeStepFactory);
|
||||||
addAutoReleasedObject(new MakeBuildStepFactory);
|
addAutoReleasedObject(new MakeStepFactory);
|
||||||
|
|
||||||
m_qtVersionManager = new QtVersionManager;
|
m_qtVersionManager = new QtVersionManager;
|
||||||
addObject(m_qtVersionManager);
|
addObject(m_qtVersionManager);
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ namespace Internal {
|
|||||||
class ProFileEditorFactory;
|
class ProFileEditorFactory;
|
||||||
class ConsoleAppWizard;
|
class ConsoleAppWizard;
|
||||||
class GuiAppWizard;
|
class GuiAppWizard;
|
||||||
class QMakeBuildStepFactory;
|
class QMakeStepFactory;
|
||||||
class MakeBuildStepFactory;
|
class MakeStepFactory;
|
||||||
class GccParserFactory;
|
class GccParserFactory;
|
||||||
class MsvcParserFactory;
|
class MsvcParserFactory;
|
||||||
class QtVersionManager;
|
class QtVersionManager;
|
||||||
|
|||||||
Reference in New Issue
Block a user