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

Method showStash

plugins/git/stashmanagerdialog.cpp:82–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void 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
107void StashManagerDialog::applyClicked()
108{

Callers

nothing calls this directly

Calls 12

pluginControllerMethod · 0.80
startReviewMethod · 0.80
documentControllerMethod · 0.80
activateDocumentMethod · 0.80
invalidFunction · 0.50
openDocumentMethod · 0.45
fileMethod · 0.45
setPrettyNameMethod · 0.45
nameMethod · 0.45
textDocumentMethod · 0.45
setModeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected