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:
@@ -57,6 +57,7 @@
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
@@ -68,18 +69,26 @@
|
||||
#include <QDialog>
|
||||
#include <QFileDialog>
|
||||
|
||||
using namespace Mercurial::Internal;
|
||||
using namespace Mercurial;
|
||||
#ifdef WITH_TESTS
|
||||
#include <QTest>
|
||||
#endif
|
||||
|
||||
using namespace VcsBase;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Mercurial {
|
||||
namespace Internal {
|
||||
|
||||
using namespace VcsBase::Constants;
|
||||
using namespace Mercurial::Constants;
|
||||
|
||||
static const VcsBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
LogOutput,
|
||||
Constants::FILELOG_ID,
|
||||
Constants::FILELOG_DISPLAY_NAME,
|
||||
Constants::FILELOG,
|
||||
Constants::LOGAPP},
|
||||
FILELOG_ID,
|
||||
FILELOG_DISPLAY_NAME,
|
||||
FILELOG,
|
||||
LOGAPP},
|
||||
|
||||
{ AnnotateOutput,
|
||||
Constants::ANNOTATELOG_ID,
|
||||
@@ -149,7 +158,15 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters));
|
||||
|
||||
addAutoReleasedObject(new CloneWizardFactory);
|
||||
auto cloneWizardFactory = new BaseCheckoutWizardFactory;
|
||||
cloneWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_MERCURIAL));
|
||||
cloneWizardFactory->setIcon(QIcon(QLatin1String(":/mercurial/images/hg.png")));
|
||||
cloneWizardFactory->setDescription(tr("Clones a Mercurial repository and tries to load the contained project."));
|
||||
cloneWizardFactory->setDisplayName(tr("Mercurial Clone"));
|
||||
cloneWizardFactory->setWizardCreator([this] (const FileName &path, QWidget *parent) {
|
||||
return new CloneWizard(path, parent);
|
||||
});
|
||||
addAutoReleasedObject(cloneWizardFactory);
|
||||
|
||||
const QString prefix = QLatin1String("hg");
|
||||
m_commandLocator = new Core::CommandLocator("Mercurial", prefix, prefix);
|
||||
@@ -679,7 +696,6 @@ void MercurialPlugin::updateActions(VcsBasePlugin::ActionState as)
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include <QTest>
|
||||
|
||||
void MercurialPlugin::testDiffFileResolving_data()
|
||||
{
|
||||
@@ -736,4 +752,7 @@ void MercurialPlugin::testLogResolving()
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Mercurial
|
||||
|
||||
Q_EXPORT_PLUGIN(MercurialPlugin)
|
||||
|
||||
Reference in New Issue
Block a user