Commit 10482c81 authored by dt's avatar dt

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)
parent 84ee1653
......@@ -315,3 +315,38 @@ void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
m_makeStep->setValue(m_buildConfiguration, "makeargs",
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/projectexplorer.h>
namespace ProjectExplorer {
class BuildStep;
class IBuildStepFactory;
class Project;
}
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;
// NBS move this class to an own plugin? So that there can be a make project at a future time
......
/**************************************************************************
**
** 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();
}
/**************************************************************************
**
** 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>
namespace ProjectExplorer {
class BuildStep;
class IBuildStepFactory;
class Project;
}
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 QMakeStep : public ProjectExplorer::AbstractProcessStep
......
......@@ -27,7 +27,6 @@ HEADERS = qt4projectmanagerplugin.h \
qt4projectmanagerconstants.h \
makestep.h \
qmakestep.h \
qmakebuildstepfactory.h \
deployhelper.h \
embeddedpropertiespage.h \
qt4runconfiguration.h \
......@@ -57,7 +56,6 @@ SOURCES = qt4projectmanagerplugin.cpp \
wizards/qtwizard.cpp \
makestep.cpp \
qmakestep.cpp \
qmakebuildstepfactory.cpp \
deployhelper.cpp \
embeddedpropertiespage.cpp \
qt4runconfiguration.cpp \
......
......@@ -122,8 +122,8 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
LibraryWizard *libWizard = new LibraryWizard;
addAutoReleasedObject(libWizard);
addAutoReleasedObject(new QMakeBuildStepFactory);
addAutoReleasedObject(new MakeBuildStepFactory);
addAutoReleasedObject(new QMakeStepFactory);
addAutoReleasedObject(new MakeStepFactory);
m_qtVersionManager = new QtVersionManager;
addObject(m_qtVersionManager);
......
......@@ -42,8 +42,8 @@ namespace Internal {
class ProFileEditorFactory;
class ConsoleAppWizard;
class GuiAppWizard;
class QMakeBuildStepFactory;
class MakeBuildStepFactory;
class QMakeStepFactory;
class MakeStepFactory;
class GccParserFactory;
class MsvcParserFactory;
class QtVersionManager;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment