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

Method findCraftRoot

plugins/craft/craftruntime.cpp:45–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45QString CraftRuntime::findCraftRoot(Path startingPoint)
46{
47 // CraftRuntime doesn't handle remote directories, because it needs
48 // to check file existence in the findCraftRoot() function
49 if (startingPoint.isRemote())
50 return QString();
51
52 QString craftRoot;
53 while (true) {
54 bool craftSettingsIniExists = QFileInfo::exists(startingPoint.path() + QLatin1String("/etc/CraftSettings.ini"));
55 bool craftSetupHelperExists = QFileInfo::exists(startingPoint.path() + craftSetupHelperRelativePath());
56 if (craftSettingsIniExists && craftSetupHelperExists) {
57 craftRoot = startingPoint.path();
58 break;
59 }
60
61 if (!startingPoint.hasParent())
62 break;
63 startingPoint = startingPoint.parent();
64 }
65
66 return QFileInfo(craftRoot).canonicalFilePath();
67}
68
69QString CraftRuntime::findPython()
70{

Callers

nothing calls this directly

Calls 7

isRemoteMethod · 0.80
hasParentMethod · 0.80
QStringClass · 0.50
QFileInfoClass · 0.50
pathMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected