Skip to content

Commit db3d9a7

Browse files
authored
Fix addons for installed cppcheck (cppcheck-opensource#2873)
- getAddonFilePath is used with getDataDir, this works fine for a local build cppcheck, but not for a system installed one. As getDataDir reports the location relative to the executable (/usr/bin/) and the addons are localed in FILESDIR (/usr/share/cppcheck). Extend the search path by FILESDIR/addons to also make it work for the installed cppcheck version.
1 parent 2c34e66 commit db3d9a7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

gui/projectfile.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,11 @@ QString ProjectFile::getAddonFilePath(QString filesDir, const QString &addon)
11511151
filesDir += "/";
11521152

11531153
QStringList searchPaths;
1154-
searchPaths << filesDir << (filesDir + "addons/") << (filesDir + "../addons/");
1154+
searchPaths << filesDir << (filesDir + "addons/") << (filesDir + "../addons/")
1155+
#ifdef FILESDIR
1156+
<< (QLatin1String(FILESDIR) + "/addons/")
1157+
#endif
1158+
;
11551159

11561160
foreach (QString path, searchPaths) {
11571161
QString f = path + addon + ".py";

0 commit comments

Comments
 (0)