mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-13 13:32:53 +08:00
python home set at windows os,fix path string encoding
This commit is contained in:
parent
a16b97cf90
commit
dd11e1096c
@ -77,19 +77,22 @@ bool AppControl::Init()
|
|||||||
QString resdir = GetResourceDir();
|
QString resdir = GetResourceDir();
|
||||||
sr_set_firmware_resource_dir(resdir.toUtf8().data());
|
sr_set_firmware_resource_dir(resdir.toUtf8().data());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
QString pythonHome = GetAppDataDir() + "/Python";
|
QString pythonHome = GetAppDataDir() + "/Python";
|
||||||
QDir pydir;
|
QDir pydir;
|
||||||
if (pydir.exists(pythonHome)){
|
if (pydir.exists(pythonHome)){
|
||||||
srd_set_python_home(pythonHome.toUtf8().data());
|
const wchar_t *pyhome = reinterpret_cast<const wchar_t*>(pythonHome.utf16());
|
||||||
|
srd_set_python_home(pyhome);
|
||||||
}else{
|
}else{
|
||||||
qDebug()<<"python home directory not exists,"<<pythonHome;
|
qDebug()<<"python home directory not exists,"<<pythonHome;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString dir = GetAppDataDir() + "/decoders";
|
|
||||||
char path[256] = {0};
|
char path[256] = {0};
|
||||||
|
QString dir = GetAppDataDir() + "/decoders";
|
||||||
strcpy(path, dir.toUtf8().data());
|
strcpy(path, dir.toUtf8().data());
|
||||||
|
|
||||||
// Initialise libsigrokdecode
|
// Initialise libsigrokdecode
|
||||||
|
@ -361,7 +361,7 @@ struct srd_pd_callback {
|
|||||||
SRD_API int srd_init(const char *path);
|
SRD_API int srd_init(const char *path);
|
||||||
SRD_API int srd_exit(void);
|
SRD_API int srd_exit(void);
|
||||||
SRD_API GSList *srd_searchpaths_get(void);
|
SRD_API GSList *srd_searchpaths_get(void);
|
||||||
SRD_API void srd_set_python_home(const char *path);
|
SRD_API void srd_set_python_home(const wchar_t *path);
|
||||||
|
|
||||||
/* session.c */
|
/* session.c */
|
||||||
SRD_API int srd_session_new(struct srd_session **sess);
|
SRD_API int srd_session_new(struct srd_session **sess);
|
||||||
|
@ -387,7 +387,7 @@ SRD_API GSList *srd_searchpaths_get(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set python home directory
|
//set python home directory
|
||||||
SRD_API void srd_set_python_home(const char *path)
|
SRD_API void srd_set_python_home(const wchar_t *path)
|
||||||
{
|
{
|
||||||
Py_SetPythonHome((wchar_t*)path);
|
Py_SetPythonHome((wchar_t*)path);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.11.0, 2021-12-10T18:13:59. -->
|
<!-- Written by QtCreator 4.11.0, 2021-12-13T10:43:31. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">true</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user