| 183 | } |
| 184 | |
| 185 | GitPlugin::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 | |
| 213 | GitPlugin::~GitPlugin() |
| 214 | {} |
nothing calls this directly
no test coverage detected