From db3d9a79b57ce5b2dc7acf0c19bd22da8d317133 Mon Sep 17 00:00:00 2001 From: Bernd Buschinski Date: Sun, 1 Nov 2020 15:11:28 +0100 Subject: [PATCH] Fix addons for installed cppcheck (#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. --- gui/projectfile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index 926d55d0c..9688e1915 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -1151,7 +1151,11 @@ QString ProjectFile::getAddonFilePath(QString filesDir, const QString &addon) filesDir += "/"; QStringList searchPaths; - searchPaths << filesDir << (filesDir + "addons/") << (filesDir + "../addons/"); + searchPaths << filesDir << (filesDir + "addons/") << (filesDir + "../addons/") +#ifdef FILESDIR + << (QLatin1String(FILESDIR) + "/addons/") +#endif + ; foreach (QString path, searchPaths) { QString f = path + addon + ".py";