forked from qt-creator/qt-creator
Vcs: Flatten the VcsBase::BaseCheckoutWizard hierarchy
Following the new simple-factory pattern Change-Id: Idceb7a339169af37a040f9da7d36d3fe22dfb347 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -40,19 +40,6 @@
|
||||
namespace Cvs {
|
||||
namespace Internal {
|
||||
|
||||
CheckoutWizardFactory::CheckoutWizardFactory()
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS));
|
||||
setIcon(QIcon(QLatin1String(":/cvs/images/cvs.png")));
|
||||
setDescription(tr("Checks out a CVS repository and tries to load the contained project."));
|
||||
setDisplayName(tr("CVS Checkout"));
|
||||
}
|
||||
|
||||
VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||
{
|
||||
return new CheckoutWizard(path, parent);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CheckoutWizard:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -36,16 +36,6 @@
|
||||
namespace Cvs {
|
||||
namespace Internal {
|
||||
|
||||
class CheckoutWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CheckoutWizardFactory();
|
||||
|
||||
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||
};
|
||||
|
||||
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "checkoutwizard.h"
|
||||
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
@@ -256,7 +257,15 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new CVSEditorFactory(editorParameters + i, this, describeSlotC));
|
||||
|
||||
addAutoReleasedObject(new CheckoutWizardFactory);
|
||||
auto checkoutWizardFactory = new BaseCheckoutWizardFactory;
|
||||
checkoutWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS));
|
||||
checkoutWizardFactory->setIcon(QIcon(QLatin1String(":/cvs/images/cvs.png")));
|
||||
checkoutWizardFactory->setDescription(tr("Checks out a CVS repository and tries to load the contained project."));
|
||||
checkoutWizardFactory->setDisplayName(tr("CVS Checkout"));
|
||||
checkoutWizardFactory->setWizardCreator([this] (const FileName &path, QWidget *parent) {
|
||||
return new CheckoutWizard(path, parent);
|
||||
});
|
||||
addAutoReleasedObject(checkoutWizardFactory);
|
||||
|
||||
const QString prefix = QLatin1String("cvs");
|
||||
m_commandLocator = new CommandLocator("CVS", prefix, prefix);
|
||||
|
||||
Reference in New Issue
Block a user