From 800317aad0bc19e90bcf3a00cf5c34c6afee28c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 15 Dec 2021 19:22:29 +0100 Subject: [PATCH] Fix execution of executable addons from GUI --- gui/mainwindow.cpp | 3 +++ lib/cppcheck.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 812970e66..30c78485e 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -854,6 +854,9 @@ Settings MainWindow::getCppcheckSettings() Settings result; + const QString applicationFilePath = QCoreApplication::applicationFilePath(); + result.exename = applicationFilePath.toStdString(); + const bool std = tryLoadLibrary(&result.library, "std.cfg"); bool posix = true; if (result.posix()) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 686ba350d..4b7c50429 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -131,7 +131,7 @@ namespace { if (obj.count("executable")) { if (!obj["executable"].is()) return "Loading " + fileName + " failed. executable must be a string."; - executable = getFullPath(obj["executable"].get(), exename); + executable = getFullPath(obj["executable"].get(), fileName); return ""; }