diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp old mode 100644 new mode 100755 index 1ee28f2ac..671e068ae --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -296,6 +296,11 @@ void CheckThread::runAddonsAndTools(const QString &addonPath, const ImportProjec qDebug() << python << args; QProcess process; + QProcessEnvironment env = process.processEnvironment(); + if (!env.contains("PYTHONHOME") && !mPythonPath.isEmpty()) { + env.insert("PYTHONHOME", QFileInfo(mPythonPath).canonicalPath()); + process.setProcessEnvironment(env); + } process.start(python, args); process.waitForFinished(); const QString errout(process.readAllStandardError()); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c394d6258..5d7a5f127 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -49,7 +49,8 @@ static const QString OnlineHelpURL("http://cppcheck.net/manual.html"); static const QString compile_commands_json("compile_commands.json"); -static QString getDataDir(const QSettings *settings) { +static QString getDataDir(const QSettings *settings) +{ const QString dataDir = settings->value("DATADIR", QString()).toString(); const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath(); return dataDir.isEmpty() ? appPath : dataDir;