OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / git / clonewizard.cpp
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #include "clonewizard.h"
34 #include "clonewizardpage.h"
35
36 #include <vcsbase/checkoutjobs.h>
37 #include <vcsbase/vcsbaseconstants.h>
38 #include <utils/qtcassert.h>
39
40 #include <QtGui/QIcon>
41
42 namespace Git {
43 namespace Internal {
44
45 CloneWizard::CloneWizard(QObject *parent) :
46         VCSBase::BaseCheckoutWizard(parent)
47 {
48     setId(QLatin1String(VCSBase::Constants::VCS_ID_GIT));
49 }
50
51 QIcon CloneWizard::icon() const
52 {
53     return QIcon(QLatin1String(":/git/images/git.png"));
54 }
55
56 QString CloneWizard::description() const
57 {
58     return tr("Clones a Git repository and tries to load the contained project.");
59 }
60
61 QString CloneWizard::displayName() const
62 {
63     return tr("Git Repository Clone");
64 }
65
66 QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path)
67 {
68     CloneWizardPage *cwp = new CloneWizardPage;
69     cwp->setPath(path);
70     QList<QWizardPage*> rc;
71     rc.push_back(cwp);
72     return rc;
73 }
74
75 QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage*> &parameterPages,
76                                                                     QString *checkoutPath)
77 {
78     // Collect parameters for the clone command.
79     const CloneWizardPage *cwp = qobject_cast<const CloneWizardPage *>(parameterPages.front());
80     QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>())
81     return cwp->createCheckoutJob(checkoutPath);
82 }
83
84 } // namespace Internal
85 } // namespace Git