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.
This commit is contained in:
Bernd Buschinski 2020-11-01 15:11:28 +01:00 committed by GitHub
parent 2c34e660b3
commit db3d9a79b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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";