| 74 | } |
| 75 | |
| 76 | QString 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 | } |
no test coverage detected