MCPcopy Create free account
hub / github.com/KDE/kdevelop / GitPlugin

Method GitPlugin

plugins/git/gitplugin.cpp:185–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185GitPlugin::GitPlugin(QObject* parent, const KPluginMetaData& metaData, const QVariantList&)
186 : DistributedVersionControlPlugin(QStringLiteral("kdevgit"), parent, metaData)
187 , m_commitToolViewFactory(new CommitToolViewFactory)
188{
189 if (QStandardPaths::findExecutable(QStringLiteral("git")).isEmpty()) {
190 setErrorDescription(i18n("Unable to find git executable. Is it installed on the system?"));
191 return;
192 }
193
194 // FIXME: Is this needed (I don't quite understand the comment
195 // in vcsstatusinfo.h which says we need to do this if we want to
196 // use VcsStatusInfo in queued signals/slots)
197 qRegisterMetaType<VcsStatusInfo>();
198
199 ICore::self()->uiController()->addToolView(i18n("Git Commit"), m_commitToolViewFactory);
200
201 setObjectName(QStringLiteral("Git"));
202
203 auto* versionJob = new GitJob(QDir::tempPath(), this, KDevelop::OutputJob::Silent);
204 *versionJob << "git" << "--version";
205 connect(versionJob, &DVcsJob::readyForParsing, this, &GitPlugin::parseGitVersionOutput);
206 ICore::self()->runController()->registerJob(versionJob);
207
208 m_watcher = new KDirWatch(this);
209 connect(m_watcher, &KDirWatch::dirty, this, &GitPlugin::fileChanged);
210 connect(m_watcher, &KDirWatch::created, this, &GitPlugin::fileChanged);
211}
212
213GitPlugin::~GitPlugin()
214{}

Callers

nothing calls this directly

Calls 6

uiControllerMethod · 0.80
registerJobMethod · 0.80
runControllerMethod · 0.80
findExecutableFunction · 0.50
isEmptyMethod · 0.45
addToolViewMethod · 0.45

Tested by

no test coverage detected