GUI: Set PYTHONPATH
This commit is contained in:
parent
ec55313c28
commit
92314b65e9
|
@ -296,6 +296,11 @@ void CheckThread::runAddonsAndTools(const QString &addonPath, const ImportProjec
|
||||||
qDebug() << python << args;
|
qDebug() << python << args;
|
||||||
|
|
||||||
QProcess process;
|
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.start(python, args);
|
||||||
process.waitForFinished();
|
process.waitForFinished();
|
||||||
const QString errout(process.readAllStandardError());
|
const QString errout(process.readAllStandardError());
|
||||||
|
|
|
@ -49,7 +49,8 @@
|
||||||
static const QString OnlineHelpURL("http://cppcheck.net/manual.html");
|
static const QString OnlineHelpURL("http://cppcheck.net/manual.html");
|
||||||
static const QString compile_commands_json("compile_commands.json");
|
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 dataDir = settings->value("DATADIR", QString()).toString();
|
||||||
const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath();
|
const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath();
|
||||||
return dataDir.isEmpty() ? appPath : dataDir;
|
return dataDir.isEmpty() ? appPath : dataDir;
|
||||||
|
|
Loading…
Reference in New Issue