Move createInitialCheckoutCommand() out from core plugin

Change-Id: I99f4795822838ac084d0d6823db96e5864e0dcdf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-08-01 11:49:33 +02:00
parent bc8ebd3bc7
commit d1284e9101
6 changed files with 34 additions and 31 deletions

View File

@@ -47,6 +47,7 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <vcsbase/vcsbaseplugin.h>
#include <vcsbase/vcscommand.h>
#include <QApplication>
@@ -61,6 +62,8 @@
#include <QPushButton>
#include <QVBoxLayout>
using namespace VcsBase;
namespace GitLab {
GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent)
@@ -147,7 +150,8 @@ void GitLabCloneDialog::updateUi()
void GitLabCloneDialog::cloneProject()
{
Core::IVersionControl *vc = Core::VcsManager::versionControl(Utils::Id::fromString("G.Git"));
VcsBasePluginPrivate *vc = static_cast<VcsBasePluginPrivate *>(
Core::VcsManager::versionControl(Utils::Id::fromString("G.Git")));
QTC_ASSERT(vc, return);
const QStringList extraArgs = m_submodulesCB->isChecked() ? QStringList{ "--recursive" }
: QStringList{};
@@ -156,13 +160,13 @@ void GitLabCloneDialog::cloneProject()
m_directoryLE->text(), extraArgs);
const Utils::FilePath workingDirectory = m_pathChooser->absoluteFilePath();
m_command->setProgressiveOutput(true);
connect(m_command, &VcsBase::VcsCommand::stdOutText, this, [this](const QString &text) {
connect(m_command, &VcsCommand::stdOutText, this, [this](const QString &text) {
m_cloneOutput->appendPlainText(text);
});
connect(m_command, &VcsBase::VcsCommand::stdErrText, this, [this](const QString &text) {
connect(m_command, &VcsCommand::stdErrText, this, [this](const QString &text) {
m_cloneOutput->appendPlainText(text);
});
connect(m_command, &VcsBase::VcsCommand::finished, this, &GitLabCloneDialog::cloneFinished);
connect(m_command, &VcsCommand::finished, this, &GitLabCloneDialog::cloneFinished);
QApplication::setOverrideCursor(Qt::WaitCursor);
m_cloneOutput->clear();