1 /***************************************************************************
2 * Copyright 2008 Evgeniy Ivanov <powerfox@kde.ru> *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation; either version 2 of *
7 * the License or (at your option) version 3 or any later version *
8 * accepted by the membership of KDE e.V. (or its successor approved *
9 * by the membership of KDE e.V.), which shall act as a proxy *
10 * defined in Section 14 of version 3 of the license. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19 ***************************************************************************/
21 #include "gitplugin.h"
23 #include <KPluginFactory>
24 #include <KPluginLoader>
25 #include <klocalizedstring.h>
28 #include <interfaces/icore.h>
29 #include <interfaces/iprojectcontroller.h>
30 #include <interfaces/iproject.h>
32 #include <vcs/vcsjob.h>
33 #include <vcs/vcsrevision.h>
34 #include <vcs/dvcs/dvcsjob.h>
36 #include "gitexecutor.h"
38 K_PLUGIN_FACTORY(KDevGitFactory
, registerPlugin
<GitPlugin
>(); )
39 K_EXPORT_PLUGIN(KDevGitFactory("kdevgit"))
41 GitPlugin::GitPlugin( QObject
*parent
, const QVariantList
& )
42 : DistributedVersionControlPlugin(parent
, KDevGitFactory::componentData())
44 KDEV_USE_EXTENSION_INTERFACE( KDevelop::IBasicVersionControl
)
45 KDEV_USE_EXTENSION_INTERFACE( KDevelop::IDistributedVersionControl
)
47 core()->uiController()->addToolView(i18n("Git"), DistributedVersionControlPlugin::d
->m_factory
);
49 QString EasterEgg
= i18n("Thanks for the translation! Have a nice day, mr. translator!");
52 setXMLFile("kdevgit.rc");
54 DistributedVersionControlPlugin::d
->m_exec
= new GitExecutor(this);
57 GitPlugin::~GitPlugin()
59 delete DistributedVersionControlPlugin::d
;
63 GitPlugin::log(const KUrl
& localLocation
,
64 const KDevelop::VcsRevision
& rev
,
70 DVCSjob
* job
= d
->m_exec
->log(localLocation
);
75 GitPlugin::log(const KUrl
& localLocation
,
76 const KDevelop::VcsRevision
& rev
,
77 const KDevelop::VcsRevision
& limit
)
80 return log(localLocation
, rev
, 0);
84 GitPlugin::checkout(const QString
&localLocation
,
85 const QString
&branch
)
87 DVCSjob
* job
= d
->m_exec
->checkout(localLocation
, branch
);
91 // #include "gitplugin.moc"