| 80 | } |
| 81 | |
| 82 | void StashManagerDialog::showStash() |
| 83 | { |
| 84 | IPatchSource::Ptr stashPatch(new StashPatchSource(selection(), m_plugin, m_dir)); |
| 85 | |
| 86 | if (auto * review = ICore::self()->pluginController()->extensionForPlugin<IPatchReview>()) { |
| 87 | review->startReview(stashPatch); |
| 88 | } else { |
| 89 | auto* docCtrl = ICore::self()->documentController(); |
| 90 | connect(stashPatch, &StashPatchSource::patchChanged, docCtrl, [=] { |
| 91 | auto* doc = docCtrl->openDocument( |
| 92 | stashPatch->file(), |
| 93 | KTextEditor::Range::invalid(), |
| 94 | IDocumentController::DoNotAddToRecentOpen |
| 95 | ); |
| 96 | doc->setPrettyName(stashPatch->name()); |
| 97 | doc->textDocument()->setReadWrite(false); |
| 98 | doc->textDocument()->setMode(QStringLiteral("diff")); |
| 99 | doc->textDocument()->setHighlightingMode(QStringLiteral("diff")); |
| 100 | docCtrl->activateDocument(doc); |
| 101 | connect(ICore::self(), &ICore::aboutToShutdown, docCtrl, [=] {doc->close();}); |
| 102 | }); |
| 103 | } |
| 104 | accept(); |
| 105 | } |
| 106 | |
| 107 | void StashManagerDialog::applyClicked() |
| 108 | { |
nothing calls this directly
no test coverage detected