forked from qt-creator/qt-creator
VCS: Replace AbstractCheckoutJob with Command
Command now provides the same functionality. Deduplicate code. Change-Id: I789f021050471281870b6ef6a81a94e66fbdf0c7 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
27e53f746f
commit
aefd61478a
@@ -33,7 +33,7 @@
|
||||
#include "mercurialsettings.h"
|
||||
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
#include <vcsbase/checkoutjobs.h>
|
||||
#include <vcsbase/command.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsconfigurationpage.h>
|
||||
|
||||
@@ -74,13 +74,13 @@ QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path)
|
||||
return wizardPageList;
|
||||
}
|
||||
|
||||
QSharedPointer<AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> ¶meterPages,
|
||||
QString *checkoutPath)
|
||||
Command *CloneWizard::createCommand(const QList<QWizardPage *> ¶meterPages,
|
||||
QString *checkoutPath)
|
||||
{
|
||||
const CloneWizardPage *page = qobject_cast<const CloneWizardPage *>(parameterPages.front());
|
||||
|
||||
if (!page)
|
||||
return QSharedPointer<AbstractCheckoutJob>();
|
||||
return 0;
|
||||
|
||||
const MercurialSettings &settings = MercurialPlugin::settings();
|
||||
|
||||
@@ -90,7 +90,8 @@ QSharedPointer<AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPa
|
||||
QStringList args;
|
||||
args << QLatin1String("clone") << page->repository() << directory;
|
||||
*checkoutPath = path + QLatin1Char('/') + directory;
|
||||
ProcessCheckoutJob *job = new ProcessCheckoutJob;
|
||||
job->addStep(settings.binaryPath(), args, path);
|
||||
return QSharedPointer<AbstractCheckoutJob>(job);
|
||||
VcsBase::Command *command = new VcsBase::Command(settings.binaryPath(), path,
|
||||
QProcessEnvironment::systemEnvironment());
|
||||
command->addJob(args, -1);
|
||||
return command;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user