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 Git {
|
||||
namespace Internal {
|
||||
|
||||
CloneWizardFactory::CloneWizardFactory()
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
||||
setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
||||
setDisplayName(tr("Git Repository Clone"));
|
||||
}
|
||||
|
||||
VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||
{
|
||||
return new CloneWizard(path, parent);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CloneWizard:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -36,16 +36,6 @@
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class CloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CloneWizardFactory();
|
||||
|
||||
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||
};
|
||||
|
||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -68,20 +68,6 @@ void GitoriousCloneWizardPage::initializePage()
|
||||
setRepository(m_repositoryPage->repositoryURL().toString());
|
||||
}
|
||||
|
||||
// -------- GitoriousCloneWizard
|
||||
GitoriousCloneWizardFactory::GitoriousCloneWizardFactory()
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
setIcon(QIcon(QLatin1String(":/git/images/gitorious.png")));
|
||||
setDescription(tr("Clones a Gitorious repository and tries to load the contained project."));
|
||||
setDisplayName(tr("Gitorious Repository Clone"));
|
||||
}
|
||||
|
||||
VcsBase::BaseCheckoutWizard *GitoriousCloneWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||
{
|
||||
return new GitoriousCloneWizard(path, parent);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// GitoriousCloneWizard:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -38,15 +38,6 @@ namespace Internal {
|
||||
|
||||
// GitoriousCloneWizard: A wizard allowing for browsing
|
||||
// Gitorious-hosted projects.
|
||||
class GitoriousCloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GitoriousCloneWizardFactory();
|
||||
|
||||
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||
};
|
||||
|
||||
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/submitfilemodel.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/cleandialog.h>
|
||||
@@ -296,8 +297,27 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
addAutoReleasedObject(new GitEditorFactory(editorParameters + i, m_gitClient, describeSlot));
|
||||
|
||||
addAutoReleasedObject(new GitSubmitEditorFactory(&submitParameters));
|
||||
addAutoReleasedObject(new CloneWizardFactory);
|
||||
addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizardFactory);
|
||||
|
||||
auto cloneWizardFactory = new VcsBase::BaseCheckoutWizardFactory;
|
||||
cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
cloneWizardFactory->setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
||||
cloneWizardFactory->setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
||||
cloneWizardFactory->setDisplayName(tr("Git Repository Clone"));
|
||||
cloneWizardFactory->setWizardCreator([this] (const Utils::FileName &path, QWidget *parent) {
|
||||
return new CloneWizard(path, parent);
|
||||
});
|
||||
addAutoReleasedObject(cloneWizardFactory);
|
||||
|
||||
// A wizard allowing for browsing Gitorious-hosted projects.
|
||||
cloneWizardFactory = new VcsBase::BaseCheckoutWizardFactory;
|
||||
cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
cloneWizardFactory->setIcon(QIcon(QLatin1String(":/git/images/gitorious.png")));
|
||||
cloneWizardFactory->setDescription(tr("Clones a Gitorious repository and tries to load the contained project."));
|
||||
cloneWizardFactory->setDisplayName(tr("Gitorious Repository Clone"));
|
||||
cloneWizardFactory->setWizardCreator([this] (const Utils::FileName &path, QWidget *parent) {
|
||||
return new Gitorious::Internal::GitoriousCloneWizard(path, parent);
|
||||
});
|
||||
addAutoReleasedObject(cloneWizardFactory);
|
||||
|
||||
const QString prefix = QLatin1String("git");
|
||||
m_commandLocator = new CommandLocator("Git", prefix, prefix);
|
||||
|
||||
Reference in New Issue
Block a user