From dd11e1096cc666e2abac30aab9209478b41d99d3 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Mon, 13 Dec 2021 11:56:25 +0800 Subject: [PATCH] python home set at windows os,fix path string encoding --- DSView/pv/appcontrol.cpp | 7 +++++-- libsigrokdecode4DSL/libsigrokdecode.h | 2 +- libsigrokdecode4DSL/srd.c | 2 +- qtpro/DSView.pro.user | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DSView/pv/appcontrol.cpp b/DSView/pv/appcontrol.cpp index 15c0e52d..23fd92d0 100644 --- a/DSView/pv/appcontrol.cpp +++ b/DSView/pv/appcontrol.cpp @@ -77,19 +77,22 @@ bool AppControl::Init() QString resdir = GetResourceDir(); sr_set_firmware_resource_dir(resdir.toUtf8().data()); + + #ifdef _WIN32 QString pythonHome = GetAppDataDir() + "/Python"; QDir pydir; if (pydir.exists(pythonHome)){ - srd_set_python_home(pythonHome.toUtf8().data()); + const wchar_t *pyhome = reinterpret_cast(pythonHome.utf16()); + srd_set_python_home(pyhome); }else{ qDebug()<<"python home directory not exists,"< - + EnvironmentId @@ -93,7 +93,7 @@ QtProjectManager.QMakeBuildStep true - false + true false false