MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getDataDir

Function getDataDir

gui/common.cpp:76–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76QString getDataDir()
77{
78 QSettings settings;
79 const QString dataDir = settings.value("DATADIR", QString()).toString();
80 if (!dataDir.isEmpty())
81 return dataDir;
82 const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath();
83 if (QFileInfo::exists(appPath + "/std.cfg"))
84 return appPath;
85 if (appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) > 0)
86 return appPath.left(appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) + 9);
87 return appPath;
88}

Callers 8

setLanguageMethod · 0.85
loadFromProjectFileMethod · 0.85
browseMisraFileMethod · 0.85
loadLibraryMethod · 0.85
getCppcheckSettingsMethod · 0.85
getHelpFileFunction · 0.85
getSearchPathsMethod · 0.85
openCfgMethod · 0.85

Calls 4

isEmptyMethod · 0.80
QStringClass · 0.70
toStringMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected