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

Method commitCurrentProject

kdevplatform/shell/projectcontroller.cpp:1271–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1269}
1270
1271void ProjectController::commitCurrentProject()
1272{
1273 IDocument* doc=ICore::self()->documentController()->activeDocument();
1274 if(!doc)
1275 return;
1276
1277 QUrl url=doc->url();
1278 IProject* project = ICore::self()->projectController()->findProjectForUrl(url);
1279 if (!project)
1280 return;
1281
1282 IPlugin* plugin = project->versionControlPlugin();
1283 if (!plugin)
1284 return;
1285 auto* vcs = plugin->extension<IBasicVersionControl>();
1286 if (!vcs)
1287 return;
1288
1289 if (!ICore::self()->documentController()->saveAllDocuments(IDocumentController::SaveSelectionMode::DontAskUser)) {
1290 return; // canceled by the user
1291 }
1292
1293 const Path basePath = project->path();
1294 auto* patchSource = new VCSCommitDiffPatchSource(new VCSStandardDiffUpdater(vcs, basePath.toUrl()));
1295
1296 bool ret = showVcsDiff(patchSource);
1297
1298 if (!ret) {
1299 ScopedDialog<VcsCommitDialog> commitDialog(patchSource);
1300 commitDialog->setCommitCandidates(patchSource->infos());
1301 commitDialog->exec();
1302 }
1303}
1304
1305QString ProjectController::mapSourceBuild( const QString& path_, bool reverse, bool fallbackRoot ) const
1306{

Callers

nothing calls this directly

Calls 12

showVcsDiffFunction · 0.85
activeDocumentMethod · 0.80
documentControllerMethod · 0.80
findProjectForUrlMethod · 0.80
projectControllerMethod · 0.80
versionControlPluginMethod · 0.80
saveAllDocumentsMethod · 0.80
setCommitCandidatesMethod · 0.80
execMethod · 0.80
urlMethod · 0.45
pathMethod · 0.45
toUrlMethod · 0.45

Tested by

no test coverage detected