| 488 | } |
| 489 | |
| 490 | void VcsPluginHelper::commit() |
| 491 | { |
| 492 | Q_D(VcsPluginHelper); |
| 493 | |
| 494 | Q_ASSERT(!d->ctxUrls.isEmpty()); |
| 495 | |
| 496 | if (!ICore::self()->documentController()->saveAllDocuments()) { |
| 497 | return; // canceled by the user |
| 498 | } |
| 499 | |
| 500 | QUrl url = d->ctxUrls.first(); |
| 501 | |
| 502 | // We start the commit UI no matter whether there is real differences, as it can also be used to commit untracked files |
| 503 | auto* patchSource = new VCSCommitDiffPatchSource(new VCSStandardDiffUpdater(d->vcs, url)); |
| 504 | |
| 505 | bool ret = showVcsDiff(patchSource); |
| 506 | |
| 507 | if(!ret) { |
| 508 | ScopedDialog<VcsCommitDialog> commitDialog(patchSource); |
| 509 | commitDialog->setCommitCandidates(patchSource->infos()); |
| 510 | commitDialog->exec(); |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | void VcsPluginHelper::push() |
| 515 | { |
nothing calls this directly
no test coverage detected