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

Method previewTemplate

plugins/filetemplates/filetemplatesplugin.cpp:301–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void FileTemplatesPlugin::previewTemplate()
302{
303 auto* action = qobject_cast<QAction*>(sender());
304 if (!action || !action->data().toUrl().isValid())
305 {
306 return;
307 }
308 auto* preview = qobject_cast<TemplatePreviewToolView*>(core()->uiController()->findToolView(i18nc("@title:window", "Template Preview"), m_toolView));
309 if (!preview)
310 {
311 return;
312 }
313
314 core()->documentController()->activateDocument(core()->documentController()->openDocument(action->data().toUrl()));
315}
316
317#include "filetemplatesplugin.moc"
318#include "moc_filetemplatesplugin.cpp"

Callers

nothing calls this directly

Calls 8

findToolViewMethod · 0.80
uiControllerMethod · 0.80
activateDocumentMethod · 0.80
documentControllerMethod · 0.80
isValidMethod · 0.45
toUrlMethod · 0.45
dataMethod · 0.45
openDocumentMethod · 0.45

Tested by

no test coverage detected