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

Function getPath

gui/common.cpp:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32
33QString getPath(const QString &type)
34{
35 QSettings settings;
36 QString path = settings.value(type, QString()).toString();
37 if (path.isEmpty()) {
38 // if not set, fallback to last check path hoping that it will be close enough
39 path = settings.value(SETTINGS_LAST_CHECK_PATH, QString()).toString();
40 if (path.isEmpty())
41 // if not set, return user's home directory as the best we can do for now
42 return QDir::homePath();
43 }
44 return path;
45}
46
47void setPath(const QString &type, const QString &value)
48{

Callers 8

getContextAndValuesMethod · 0.85
askFileDirMethod · 0.85
selectFilesToAnalyzeMethod · 0.85
openResultsMethod · 0.85
saveMethod · 0.85
openProjectFileMethod · 0.85
newProjectFileMethod · 0.85
browseMethod · 0.85

Calls 4

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

Tested by

no test coverage detected