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

Method commitActiveProject

plugins/git/committoolview.cpp:457–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457void CommitToolView::commitActiveProject()
458{
459 if (auto* proj = activeProject()) {
460 if (auto* vcs = proj->versionControlPlugin()->extension<GitPlugin>()) {
461 QString msg = m_commitForm->summary();
462 QString extended = m_commitForm->extendedDescription(70);
463 if (extended.length() > 0)
464 msg += QStringLiteral("\n\n") + extended;
465 VcsJob* job = vcs->commitStaged(msg, proj->projectItem()->path().toUrl());
466 m_commitForm->clearError();
467 m_commitForm->disable();
468 connect(job, &VcsJob::finished, m_commitForm, [=]{
469 if (job->status() == VcsJob::JobSucceeded){
470 m_commitForm->clear();
471 emit updateProjectDiffs(proj);
472 } else {
473 m_commitForm->showError(i18n("Committing failed. See Version Control tool view."));
474 }
475 m_commitForm->enable();
476 });
477 ICore::self()->runController()->registerJob(job);
478 }
479 }
480}
481
482#include "committoolview.moc"
483#include "moc_committoolview.cpp"

Callers

nothing calls this directly

Calls 15

versionControlPluginMethod · 0.80
summaryMethod · 0.80
extendedDescriptionMethod · 0.80
commitStagedMethod · 0.80
clearErrorMethod · 0.80
registerJobMethod · 0.80
runControllerMethod · 0.80
lengthMethod · 0.45
toUrlMethod · 0.45
pathMethod · 0.45
projectItemMethod · 0.45
disableMethod · 0.45

Tested by

no test coverage detected