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

Method openDefault

plugins/openwith/openwithplugin.cpp:332–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void OpenWithPlugin::openDefault() const
333{
334 // check preferred handler
335 if (m_defaultOpener.isValid()) {
336 if (m_defaultOpener.isPart()) {
337 delegateToParts(m_defaultOpener.id());
338 } else {
339 delegateToExternalApplication(m_defaultOpener.service());
340 }
341 return;
342 }
343
344 // default handlers
345 if (isDirectory(m_mimeType)) {
346 KService::Ptr service = KApplicationTrader::preferredService(m_mimeType);
347 delegateToExternalApplication(service);
348 } else {
349 for (const QUrl& u : std::as_const(m_urls)) {
350 ICore::self()->documentController()->openDocument( u );
351 }
352 }
353}
354
355void OpenWithPlugin::delegateToParts(const QString& pluginId) const
356{

Callers

nothing calls this directly

Calls 6

isDirectoryFunction · 0.85
isPartMethod · 0.80
documentControllerMethod · 0.80
isValidMethod · 0.45
idMethod · 0.45
openDocumentMethod · 0.45

Tested by

no test coverage detected