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

Method areBuddies

kdevplatform/shell/tests/test_shellbuddy.cpp:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34class TestBuddyFinder : public KDevelop::IBuddyDocumentFinder
35{
36 bool areBuddies(const QUrl& url1, const QUrl& url2) override
37 {
38 const QStringList name1 = url1.fileName().split('.');
39 const QStringList name2 = url2.fileName().split('.');
40 if (name1.size() != 3 || name2.size() != 3) {
41 return false;
42 }
43 if (name1.last() != name2.last() || name1.first() != name2.first()) {
44 return false;
45 }
46 if (name1.at(1) == name2.at(1)) {
47 return false;
48 }
49 if (name1.at(1) != QLatin1String("l") && name1.at(1) != QLatin1String("r")) {
50 return false;
51 }
52 if (name2.at(1) != QLatin1String("l") && name2.at(1) != QLatin1String("r")) {
53 return false;
54 }
55 qDebug() << "found buddies: " << url1 << url2;
56 return true;
57 }
58 bool buddyOrder(const QUrl& url1, const QUrl& /*url2*/) override
59 {
60 const QStringList name1 = url1.fileName().split('.');

Callers 2

findBuddyDocumentMethod · 0.45
openDocumentInternalMethod · 0.45

Calls 6

splitMethod · 0.45
fileNameMethod · 0.45
sizeMethod · 0.45
lastMethod · 0.45
firstMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected