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

Function findSwitchCandidate

plugins/switchtobuddy/switchtobuddyplugin.cpp:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58QString findSwitchCandidate(const QUrl& docUrl)
59{
60 QMimeDatabase db;
61 IBuddyDocumentFinder* finder = IBuddyDocumentFinder::finderForMimeType(db.mimeTypeForUrl(docUrl).name());
62 if (finder) {
63 // get the first entry that exists, use that as candidate
64 const auto potentialBuddies = finder->potentialBuddies(docUrl);
65 for (const QUrl& buddyUrl : potentialBuddies) {
66 if (!QFile::exists(buddyUrl.toLocalFile())) {
67 continue;
68 }
69
70 return buddyUrl.toLocalFile();
71 }
72 }
73 return QString();
74}
75
76}
77

Callers 2

switchHeaderSourceMethod · 0.85

Calls 4

toLocalFileMethod · 0.80
QStringClass · 0.50
nameMethod · 0.45
potentialBuddiesMethod · 0.45

Tested by

no test coverage detected