| 455 | } |
| 456 | |
| 457 | void 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" |
nothing calls this directly
no test coverage detected