~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/git/clonewizardpage.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "gitplugin.h"
32
32
#include "gitclient.h"
33
33
 
34
 
#include <vcsbase/checkoutjobs.h>
 
34
#include <vcsbase/command.h>
 
35
 
 
36
#include <QCheckBox>
35
37
 
36
38
namespace Git {
37
39
 
43
45
    const QString mainLinePostfix;
44
46
    const QString gitPostFix;
45
47
    const QString protocolDelimiter;
 
48
    QCheckBox *recursiveCheckBox;
46
49
};
47
50
 
48
51
CloneWizardPagePrivate::CloneWizardPagePrivate() :
49
52
    mainLinePostfix(QLatin1String("/mainline.git")),
50
53
    gitPostFix(QLatin1String(".git")),
51
 
    protocolDelimiter(QLatin1String("://"))
 
54
    protocolDelimiter(QLatin1String("://")),
 
55
    recursiveCheckBox(0)
52
56
{
53
57
}
54
58
 
68
72
    setTitle(tr("Location"));
69
73
    setSubTitle(tr("Specify repository URL, checkout directory and path."));
70
74
    setRepositoryLabel(tr("Clone URL:"));
 
75
    d->recursiveCheckBox = new QCheckBox(tr("Recursive"));
 
76
    addLocalControl(d->recursiveCheckBox);
71
77
}
72
78
 
73
79
CloneWizardPage::~CloneWizardPage()
112
118
    return url;
113
119
}
114
120
 
115
 
QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(QString *checkoutPath) const
 
121
VcsBase::Command *CloneWizardPage::createCheckoutJob(QString *checkoutPath) const
116
122
{
117
123
     const Internal::GitClient *client = Internal::GitPlugin::instance()->gitClient();
118
124
     const QString workingDirectory = path();
119
125
     const QString checkoutDir = directory();
120
126
     *checkoutPath = workingDirectory + QLatin1Char('/') + checkoutDir;
121
127
 
122
 
     const QString binary = client->gitBinaryPath();
123
 
 
124
 
     VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob;
125
 
     const QProcessEnvironment env = client->processEnvironment();
126
128
     const QString checkoutBranch = branch();
127
129
 
128
130
     QStringList args(QLatin1String("clone"));
129
131
     if (!checkoutBranch.isEmpty())
130
132
         args << QLatin1String("--branch") << checkoutBranch;
131
 
     args << repository() << checkoutDir;
132
 
     job->addStep(binary, args, workingDirectory, env);
133
 
     return QSharedPointer<VcsBase::AbstractCheckoutJob>(job);
 
133
     if (d->recursiveCheckBox->isChecked())
 
134
         args << QLatin1String("--recursive");
 
135
     args << QLatin1String("--progress") << repository() << checkoutDir;
 
136
     VcsBase::Command *command = new VcsBase::Command(client->gitBinaryPath(), workingDirectory,
 
137
                                                      client->processEnvironment());
 
138
     command->addFlags(VcsBase::VcsBasePlugin::MergeOutputChannels);
 
139
     command->addJob(args, -1);
 
140
     return command;
134
141
}
135
142
 
136
143
QStringList CloneWizardPage::branches(const QString &repository, int *current)