Run SALOME with UNICODE path

This commit is contained in:
rnv 2019-02-21 11:57:50 +03:00
parent 7f0efc8881
commit 88dc4db51c
2 changed files with 19 additions and 8 deletions

View File

@ -512,7 +512,13 @@ bool GEOM_Engine::Save(const char* theFileName)
{ {
if(!_document) return false; if(!_document) return false;
_OCAFApp->SaveAs(_document, theFileName); #if defined(WIN32) && defined(UNICODE)
std::wstring aFileName = Kernel_Utils::utf8_decode_s(theFileName);
#else
std::string aFileName = theFileName;
#endif
_OCAFApp->SaveAs( _document, aFileName.c_str() );
return true; return true;
} }
@ -524,8 +530,13 @@ bool GEOM_Engine::Save(const char* theFileName)
//============================================================================= //=============================================================================
bool GEOM_Engine::Load(const char* theFileName) bool GEOM_Engine::Load(const char* theFileName)
{ {
#if defined(WIN32) && defined(UNICODE)
std::wstring aFileName = Kernel_Utils::utf8_decode_s(theFileName);
#else
std::string aFileName = theFileName;
#endif
Handle(TDocStd_Document) aDoc; Handle(TDocStd_Document) aDoc;
if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) { if (_OCAFApp->Open(aFileName.c_str(), aDoc) != PCDM_RS_OK) {
return false; return false;
} }

View File

@ -256,11 +256,11 @@ GEOMGUI* GeometryGUI::getLibrary( const QString& libraryName )
if ( !myGUIMap.contains( libraryName ) ) { if ( !myGUIMap.contains( libraryName ) ) {
// try to load library if it is not loaded yet // try to load library if it is not loaded yet
#if defined(WIN32) #if defined(WIN32)
QString dirs = getenv( "PATH" ); QString dirs = Qtx::getenv( "PATH" );
#elif defined(__APPLE__) #elif defined(__APPLE__)
QString dirs = getenv( "DYLD_LIBRARY_PATH" ); QString dirs = Qtx::getenv( "DYLD_LIBRARY_PATH" );
#else #else
QString dirs = getenv( "LD_LIBRARY_PATH" ); QString dirs = Qtx::getenv( "LD_LIBRARY_PATH" );
#endif #endif
#if defined(WIN32) #if defined(WIN32)
QString sep = ";"; QString sep = ";";
@ -307,11 +307,11 @@ GEOMPluginGUI* GeometryGUI::getPluginLibrary( const QString& libraryName )
// try to load library if it is not loaded yet // try to load library if it is not loaded yet
#if defined(WIN32) #if defined(WIN32)
QString dirs = getenv( "PATH" ); QString dirs = Qtx::getenv( "PATH" );
#elif defined(__APPLE__) #elif defined(__APPLE__)
QString dirs = getenv( "DYLD_LIBRARY_PATH" ); QString dirs = Qtx::getenv( "DYLD_LIBRARY_PATH" );
#else #else
QString dirs = getenv( "LD_LIBRARY_PATH" ); QString dirs = Qtx::getenv( "LD_LIBRARY_PATH" );
#endif #endif
#if defined(WIN32) #if defined(WIN32)
QString sep = ";"; QString sep = ";";