From 331294345d3e1716fbf79ae25a2851011729be79 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 22 Jan 2018 11:54:45 +0300 Subject: [PATCH] Unicode support: correct handling of unicode on GUI level --- src/CAM/CAM_Application.cxx | 4 +- src/GLViewer/GLViewer_Object.cxx | 2 +- src/GLViewer/GLViewer_Viewer2d.cxx | 4 +- src/HelpBrowser/HelpBrowser.cxx | 2 +- src/LightApp/LightApp_Application.cxx | 6 +-- src/LightApp/LightApp_Displayer.cxx | 6 +-- src/LightApp/LightApp_Driver.cxx | 4 +- src/LightApp/LightApp_OBSelector.cxx | 4 +- src/LightApp/LightApp_Plot2dSelector.cxx | 4 +- src/LightApp/LightApp_SelectionMgr.cxx | 6 +-- src/LightApp/LightApp_Study.cxx | 6 +-- src/LightApp/LightApp_VTKSelector.cxx | 2 +- .../OCCViewer_CreateRestoreViewDlg.cxx | 2 +- src/OCCViewer/OCCViewer_CubeAxesDlg.cxx | 2 +- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 6 +-- src/OCCViewer/OCCViewer_ViewWindow.cxx | 4 +- src/Plot2d/Plot2d_AnalyticalParser.cxx | 2 +- src/Qtx/Qtx.cxx | 8 ++-- src/Qtx/QtxToolBar.cxx | 2 +- src/Qtx/QtxWorkstack.cxx | 4 +- .../SALOME_PYQT_DataModelLight.cxx | 4 +- .../SALOME_PYQT_PyModule.cxx | 38 +++++++++---------- .../SALOME_PYQT_Selector.cxx | 4 +- src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 2 +- src/SALOME_SWIG/SALOMEGUI_Swig.cxx | 10 ++--- src/SOCC/SOCC_ViewModel.cxx | 2 +- src/SPlot2d/SPlot2d_ViewModel.cxx | 2 +- src/SUIT/SUIT_Session.cxx | 4 +- src/SUIT/SUIT_Tools.cxx | 2 +- src/SUITApp/SUITApp_init_python.cxx | 2 +- src/SVTK/SVTK_CubeAxesDlg.cxx | 2 +- src/SVTK/SVTK_Recorder.cxx | 4 +- src/SVTK/SVTK_RecorderDlg.cxx | 2 +- src/SVTK/SVTK_View.cxx | 2 +- src/SVTK/SVTK_ViewWindow.cxx | 8 ++-- src/SalomeApp/SalomeApp_Application.cxx | 2 +- src/SalomeApp/SalomeApp_DataModel.cxx | 8 ++-- src/SalomeApp/SalomeApp_DataObject.cxx | 2 +- src/SalomeApp/SalomeApp_Module.cxx | 2 +- src/SalomeApp/SalomeApp_NoteBook.cxx | 20 +++++----- src/SalomeApp/SalomeApp_Study.cxx | 4 +- src/VTKViewer/VTKViewer_PolyDataMapper.cxx | 2 +- src/VTKViewer/VTKViewer_ViewWindow.cxx | 2 +- 43 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index ad4866492..7721f9f62 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -320,7 +320,7 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show GET_VERSION_FUNC getVersion = 0; #ifdef WIN32 - HINSTANCE modLib = ::LoadLibrary( libName.toLatin1() ); + HINSTANCE modLib = ::LoadLibrary( libName.toUtf8() ); if ( !modLib ) { LPVOID lpMsgBuf; @@ -344,7 +344,7 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show getVersion = (GET_VERSION_FUNC)::GetProcAddress( modLib, GET_VERSION_NAME ); } #else - void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY | RTLD_GLOBAL ); + void* modLib = dlopen( libName.toUtf8(), RTLD_LAZY | RTLD_GLOBAL ); if ( !modLib ) err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() ); else diff --git a/src/GLViewer/GLViewer_Object.cxx b/src/GLViewer/GLViewer_Object.cxx index 99ba4263d..fa54128d7 100644 --- a/src/GLViewer/GLViewer_Object.cxx +++ b/src/GLViewer/GLViewer_Object.cxx @@ -140,7 +140,7 @@ QByteArray GLViewer_Object::getByteCopy() int anISize = sizeof( int ); const char* aTypeStr = myType.toLatin1().constData(); - const char* aToolTipStr = myToolTipText.toLatin1().constData(); + const char* aToolTipStr = myToolTipText.toUtf8().constData(); int aTypeLength = myType.length(); int aToolTipLength = myToolTipText.length(); diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index b91b6248a..e79b9f3a5 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -731,7 +731,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap if ( !getActiveView() ) return false; - QFile hFile( FileName.toLatin1() ); + QFile hFile( FileName.toUtf8() ); #ifdef WIN32 HDC hMetaFileDC; @@ -793,7 +793,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap HDC screen_dc = GetDC( 0 ); //The screen device context HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen - hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toLatin1().data(), &r, "" ); + hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toUtf8().data(), &r, "" ); SetMapMode( hMetaFileDC, MM_HIMETRIC ); SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL ); HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH ); diff --git a/src/HelpBrowser/HelpBrowser.cxx b/src/HelpBrowser/HelpBrowser.cxx index be650d8eb..9848af0ba 100644 --- a/src/HelpBrowser/HelpBrowser.cxx +++ b/src/HelpBrowser/HelpBrowser.cxx @@ -48,7 +48,7 @@ namespace std::cout << std::endl; std::cout << "SALOME Help Browser" << std::endl; std::cout << std::endl; - std::cout << "usage: " << qPrintable( fi.fileName() ) << " [options] file" << std::endl; + std::cout << "usage: " << qUtf8Printable( fi.fileName() ) << " [options] file" << std::endl; std::cout << " file is a help file to be opened" << std::endl; std::cout << std::endl; std::cout << "Options:" << std::endl; diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index a649d14fa..c451c3734 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -611,7 +611,7 @@ void LightApp_Application::createActions() QString modName = moduleName( aModule ); // module name if ( modName.isEmpty() ) modName = aModule; // for KERNEL and GUI QString rootDir = QString( "%1_ROOT_DIR" ).arg( modName ); // module root dir variable - QString modDir = getenv( rootDir.toLatin1().constData() ); // module root dir + QString modDir = getenv( rootDir.toUtf8().constData() ); // module root dir QString docSection; if (resMgr->hasValue( modName, "documentation" ) ) docSection = resMgr->stringValue(modName, "documentation"); @@ -4780,9 +4780,9 @@ QString LightApp_Application::browseObjects( const QStringList& theEntryList, SUIT_DataOwnerPtrList aList; #ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject - ( anObject->entry().toLatin1().constData(), + ( anObject->entry().toUtf8().constData(), anObject->componentDataType().toLatin1().constData(), - anObject->name().toLatin1().constData() ); + anObject->name().toUtf8().constData() ); LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj ); #else LightApp_DataOwner* owner = new LightApp_DataOwner( anEntry ); diff --git a/src/LightApp/LightApp_Displayer.cxx b/src/LightApp/LightApp_Displayer.cxx index a490d9c88..fd9d54ea6 100644 --- a/src/LightApp/LightApp_Displayer.cxx +++ b/src/LightApp/LightApp_Displayer.cxx @@ -169,7 +169,7 @@ void LightApp_Displayer::Erase( const QStringList& list, const bool forced, QStringList::const_iterator it = list.constBegin(); for ( ; it != list.constEnd(); ++it) { - SALOME_Prs* prs = vf->CreatePrs( (*it).toLatin1().data() ); + SALOME_Prs* prs = vf->CreatePrs( (*it).toUtf8().data() ); if ( prs ) { myLastEntry = *it; vf->BeforeErase( this, prs ); @@ -218,7 +218,7 @@ bool LightApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theView { #ifndef DISABLE_SALOMEOBJECT Handle( SALOME_InteractiveObject ) temp = new SALOME_InteractiveObject(); - temp->setEntry( entry.toLatin1() ); + temp->setEntry( entry.toUtf8() ); res = vf->isVisible( temp ); #endif } @@ -248,7 +248,7 @@ SALOME_Prs* LightApp_Displayer::buildPresentation( const QString& entry, SALOME_ SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); if ( vf ) - prs = vf->CreatePrs( entry.toLatin1() ); + prs = vf->CreatePrs( entry.toUtf8() ); return prs; } diff --git a/src/LightApp/LightApp_Driver.cxx b/src/LightApp/LightApp_Driver.cxx index dd51220bf..957af1f87 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -83,7 +83,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile if(aFileBuffer == NULL) return false; - myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ; + myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toUtf8().constData() ; int aCurrentPos = 0; @@ -142,7 +142,7 @@ bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFi ifstream aFile(theFileName); #endif - myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ; + myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toUtf8().constData() ; aFile.seekg(0, ios::end); int aFileBufferSize = aFile.tellg(); diff --git a/src/LightApp/LightApp_OBSelector.cxx b/src/LightApp/LightApp_OBSelector.cxx index 7eb1399e8..b325a094a 100644 --- a/src/LightApp/LightApp_OBSelector.cxx +++ b/src/LightApp/LightApp_OBSelector.cxx @@ -130,9 +130,9 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const if ( obj && app->checkDataObject( obj) ) { #ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject - ( obj->entry().toLatin1().constData(), + ( obj->entry().toUtf8().constData(), obj->componentDataType().toLatin1().constData(), - obj->name().toLatin1().constData() ); + obj->name().toUtf8().constData() ); LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj ); #else LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() ); diff --git a/src/LightApp/LightApp_Plot2dSelector.cxx b/src/LightApp/LightApp_Plot2dSelector.cxx index 8b754fb69..f903cb5da 100755 --- a/src/LightApp/LightApp_Plot2dSelector.cxx +++ b/src/LightApp/LightApp_Plot2dSelector.cxx @@ -57,7 +57,7 @@ void LightApp_Plot2dSelector::getSelection( SUIT_DataOwnerPtrList& theList ) con { if( !myCurEntry.isNull() ) { #ifndef DISABLE_SALOMEOBJECT - theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qPrintable(myCurEntry),"","") ) ); + theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qUtf8Printable(myCurEntry),"","") ) ); #else theList.append( new LightApp_DataOwner( myCurEntry ) ); #endif @@ -76,7 +76,7 @@ void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList anIOList.Append(owner->IO()); } else if ( !owner->entry().isEmpty() ) { - anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") ); + anIOList.Append( new SALOME_InteractiveObject(qUtf8Printable(owner->entry()),"","") ); } } } diff --git a/src/LightApp/LightApp_SelectionMgr.cxx b/src/LightApp/LightApp_SelectionMgr.cxx index 9b0eafe5c..89875ec57 100644 --- a/src/LightApp/LightApp_SelectionMgr.cxx +++ b/src/LightApp/LightApp_SelectionMgr.cxx @@ -155,7 +155,7 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, if ( refEntry != entry ) { entry = refEntry; QString component = study->componentDataType( entry ); - theList.Append( new SALOME_InteractiveObject( (const char*)entry.toLatin1(), + theList.Append( new SALOME_InteractiveObject( (const char*)entry.toUtf8(), (const char*)component.toLatin1(), ""/*refobj->Name().c_str()*/ ) ); } @@ -425,7 +425,7 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) if ( subOwner ) { //#ifndef WIN32 - if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toLatin1().data()) ) ) + if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toUtf8().data()) ) ) //#else // if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) ) //#endif @@ -442,7 +442,7 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) anIndexes.Add( subOwner2->index() ); } // - theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes ); + theMap.Bind( subOwner->entry().toUtf8().data(), anIndexes ); } } } diff --git a/src/LightApp/LightApp_Study.cxx b/src/LightApp/LightApp_Study.cxx index debdb25b4..ba9a85196 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -335,7 +335,7 @@ void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOf for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) { if ( (*it).isEmpty() ) continue; - aListOfFiles[anIndex] = (*it).toLatin1().constData(); + aListOfFiles[anIndex] = (*it).toUtf8().constData(); anIndex++; } myDriver->SetListOfFiles(theModuleName.toLatin1().constData(), aListOfFiles); @@ -368,7 +368,7 @@ bool LightApp_Study::saveStudyData( const QString& theFileName ) return false; bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ); - bool aRes = myDriver->SaveDatasInFile(theFileName.toLatin1(), isMultiFile); + bool aRes = myDriver->SaveDatasInFile(theFileName.toUtf8(), isMultiFile); return aRes; } @@ -382,7 +382,7 @@ bool LightApp_Study::openStudyData( const QString& theFileName ) return false; bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ); - bool aRes = myDriver->ReadDatasFromFile(theFileName.toLatin1(), isMultiFile); + bool aRes = myDriver->ReadDatasFromFile(theFileName.toUtf8(), isMultiFile); return aRes; } diff --git a/src/LightApp/LightApp_VTKSelector.cxx b/src/LightApp/LightApp_VTKSelector.cxx index c5f81eecb..70db9624f 100644 --- a/src/LightApp/LightApp_VTKSelector.cxx +++ b/src/LightApp/LightApp_VTKSelector.cxx @@ -238,7 +238,7 @@ LightApp_VTKSelector aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false); }else if(const LightApp_DataOwner* anOwner = dynamic_cast(aDataOwner)){ Handle(SALOME_InteractiveObject) anIO = - new SALOME_InteractiveObject(anOwner->entry().toLatin1(),""); + new SALOME_InteractiveObject(anOwner->entry().toUtf8(),""); aSelector->AddIObject(anIO); anAppendList.Append(anIO); } diff --git a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx index 4c4ae27b0..f7544f9df 100755 --- a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx +++ b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx @@ -222,7 +222,7 @@ const viewAspectList& OCCViewer_CreateRestoreViewDlg::parameters() const void OCCViewer_CreateRestoreViewDlg::editItemText( QListWidgetItem* anItem ) { int index = anItem->listWidget()->row( anItem ); - myParametersMap[ index ].name = anItem->text().toLatin1(); + myParametersMap[ index ].name = anItem->text().toUtf8(); } /*! diff --git a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx index 992e4a5d5..86c919b99 100644 --- a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx +++ b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx @@ -268,7 +268,7 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView ) // axes params for ( int i = 0; i < 3; i++ ) { Graphic3d_AxisAspect& aspect = gt.ChangeAxisAspect(i); - aspect.SetName(anAxisData[i].Name.toLatin1().constData()); + aspect.SetName(anAxisData[i].Name.toUtf8().constData()); aspect.SetDrawName(anAxisData[i].DrawName); aspect.SetDrawValues(anAxisData[i].DrawValues); aspect.SetDrawTickmarks(anAxisData[i].DrawTickmarks); diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index cdf1edfe9..73f89e213 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -358,13 +358,13 @@ void OCCViewer_ViewPort3d::updateBackground() // set texture image: file name and fill mode switch ( textureMode ) { case Qtx::CenterTexture: - activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED ); + activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_CENTERED ); break; case Qtx::TileTexture: - activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED ); + activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_TILED ); break; case Qtx::StretchTexture: - activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH ); + activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_STRETCH ); break; default: break; diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 367c85151..3f3217a96 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -2256,7 +2256,7 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, OpenGl_Caps* aCaps = &aDriver->ChangeOptions(); int prev = aCaps->ffpEnable; aCaps->ffpEnable = 1; - res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript); + res = a3dView->Export(strdup(qUtf8Printable(fileName)), Graphic3d_EF_PostScript); aCaps->ffpEnable = prev; } else if (format == "EPS") { @@ -2264,7 +2264,7 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, OpenGl_Caps* aCaps = &aDriver->ChangeOptions(); int prev = aCaps->ffpEnable; aCaps->ffpEnable = 1; - res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript); + res = a3dView->Export(strdup(qUtf8Printable(fileName)), Graphic3d_EF_EnhPostScript); aCaps->ffpEnable = prev; } else { diff --git a/src/Plot2d/Plot2d_AnalyticalParser.cxx b/src/Plot2d/Plot2d_AnalyticalParser.cxx index 09f963b80..a8de35e82 100755 --- a/src/Plot2d/Plot2d_AnalyticalParser.cxx +++ b/src/Plot2d/Plot2d_AnalyticalParser.cxx @@ -182,7 +182,7 @@ int Plot2d_AnalyticalParser::calculate( const QString& theExpr, aPyScript = aPyScript.arg(theExpr); int result = -1; PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject* obj = PyRun_String(qPrintable(aPyScript), Py_file_input, myMainDict, NULL); + PyObject* obj = PyRun_String(qUtf8Printable(aPyScript), Py_file_input, myMainDict, NULL); if(obj == NULL) { PyErr_Print(); diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index 0fe626c72..8d98abdb5 100755 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -543,14 +543,14 @@ QString Qtx::addSlash( const QString& path ) */ bool Qtx::dos2unix( const QString& absName ) { - FILE* src = ::fopen( absName.toLatin1(), "rb" ); + FILE* src = ::fopen( absName.toUtf8(), "rb" ); if ( !src ) return false; /* we'll use temporary file */ char temp[512] = { '\0' }; QString dir = Qtx::dir( absName ); - FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toLatin1(), "__x" ) ), "wb" ); + FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toUtf8(), "__x" ) ), "wb" ); if ( !tgt ) return false; @@ -727,8 +727,8 @@ QString Qtx::makeEnvVarSubst( const QString& str, const SubstMode mode ) break; QString newStr; - if ( ::getenv( envName.toLatin1() ) || mode == Always ) - newStr = QString( ::getenv( envName.toLatin1() ) ); + if ( ::getenv( envName.toUtf8() ) || mode == Always ) + newStr = QString( ::getenv( envName.toUtf8() ) ); if ( newStr.isNull() ) { diff --git a/src/Qtx/QtxToolBar.cxx b/src/Qtx/QtxToolBar.cxx index 5840e9985..8216084c2 100644 --- a/src/Qtx/QtxToolBar.cxx +++ b/src/Qtx/QtxToolBar.cxx @@ -238,7 +238,7 @@ void QtxToolBar::Watcher::installFilters() const QObjectList& objList = myCont->children(); for ( QObjectList::const_iterator it = objList.begin(); it != objList.end(); ++it ) { - if ( (*it)->isWidgetType() && qstrcmp( "qt_dockwidget_internal", (*it)->objectName().toLatin1() ) ) + if ( (*it)->isWidgetType() && qstrcmp( "qt_dockwidget_internal", (*it)->objectName().toUtf8() ) ) (*it)->installEventFilter( this ); } } diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 9de0de4c7..8ae7b6158 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -884,7 +884,7 @@ bool QtxWorkstackArea::restoreState( QDataStream& stream, QMapwidget()->objectName(), c ); - qDebug( "QtxWorkstack::restoreState: found widget \"%s\"", (const char*)c->widget()->objectName().toLatin1() ); + qDebug( "QtxWorkstack::restoreState: found widget \"%s\"", (const char*)c->widget()->objectName().toUtf8() ); } } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx index 99e4222e0..5163fcc14 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx @@ -91,7 +91,7 @@ bool SALOME_PYQT_DataModelLight::save( QStringList& theListOfFiles) return false; - std::string aTmpDir = study->GetTmpDir(myStudyURL.toLatin1().constData(), isMultiFile ); + std::string aTmpDir = study->GetTmpDir(myStudyURL.toUtf8().constData(), isMultiFile ); theListOfFiles.append(QString(aTmpDir.c_str())); int listSize = theListOfFiles.size(); @@ -141,7 +141,7 @@ bool SALOME_PYQT_DataModelLight::dumpPython( const QString& theURL, if(!aModule || !study) return false; - std::string aTmpDir = study->GetTmpDir( theURL.toLatin1().constData(), isMultiFile ); + std::string aTmpDir = study->GetTmpDir( theURL.toUtf8().constData(), isMultiFile ); theListOfFiles.append( QString( aTmpDir.c_str() ) ); int oldSize = theListOfFiles.size(); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx index ce5f82caf..787d8d5fd 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx @@ -371,7 +371,7 @@ QIcon PyModuleHelper::XmlHandler::loadIcon( const QString& fileName ) SUIT_ResourceMgr* resMgr = module()->getApp()->resourceMgr(); QPixmap pixmap = resMgr->loadPixmap( module()->name(), QApplication::translate( module()->name().toLatin1().data(), - fileName.toLatin1().data() ) ); + fileName.toUtf8().data() ) ); if ( !pixmap.isNull() ) icon = QIcon( pixmap ); } @@ -2162,8 +2162,8 @@ void PyModuleHelper::internalPreferencesChanged( const QString& section, const Q PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"preferenceChanged", (char*)"ss", - section.toLatin1().constData(), - setting.toLatin1().constData() ) ); + section.toUtf8().constData(), + setting.toUtf8().constData() ) ); if( !res ) { PyErr_Print(); } @@ -2315,9 +2315,9 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu ) PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"definePopup", (char*)"sss", - context.toLatin1().constData(), - aObject.toLatin1().constData(), - aParent.toLatin1().constData() ) ); + context.toUtf8().constData(), + aObject.toUtf8().constData(), + aParent.toUtf8().constData() ) ); if( !res ) { PyErr_Print(); } @@ -2350,7 +2350,7 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu ) (char*)"createPopupMenu", (char*)"Os", sipPopup.get(), - context.toLatin1().constData() ) ); + context.toUtf8().constData() ) ); if( !res1 ) { PyErr_Print(); } @@ -2363,9 +2363,9 @@ void PyModuleHelper::internalContextMenu( const QString& context, QMenu* menu ) (char*)"customPopup", (char*)"Osss", sipPopup.get(), - aContext.toLatin1().constData(), - aObject.toLatin1().constData(), - aParent.toLatin1().constData() ) ); + aContext.toUtf8().constData(), + aObject.toUtf8().constData(), + aParent.toUtf8().constData() ) ); if( !res2 ) { PyErr_Print(); } @@ -2509,12 +2509,12 @@ void PyModuleHelper::internalSave( QStringList& files, const QString& url ) // try with two parameters (new syntax) PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"saveFiles", (char*)"ss", - files.first().toLatin1().constData(), - url.toLatin1().constData() ) ); + files.first().toUtf8().constData(), + url.toUtf8().constData() ) ); if ( !res ) // try with single parameter (old syntax) res = PyObject_CallMethod( myPyModule, (char*)"saveFiles", - (char*)"s", files.first().toLatin1().constData() ); + (char*)"s", files.first().toUtf8().constData() ); if ( !res ) { PyErr_Print(); @@ -2569,7 +2569,7 @@ void PyModuleHelper::internalLoad( const QStringList& files, const QString& url, // try with two parameters (new syntax) PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"openFiles", (char*)"Os", sipList.get(), - url.toLatin1().constData() ) ); + url.toUtf8().constData() ) ); if ( !res ) // try with single parameter (old syntax) @@ -2603,7 +2603,7 @@ void PyModuleHelper::internalDumpPython( QStringList& files ) if ( PyObject_HasAttrString(myPyModule, (char*)"dumpStudy") ) { PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"dumpStudy", - (char*)"s", files.first().toLatin1().constData())); + (char*)"s", files.first().toUtf8().constData())); if ( !res ) { PyErr_Print(); @@ -2649,7 +2649,7 @@ bool PyModuleHelper::internalIsDraggable( LightApp_DataObject* what ) if ( PyObject_HasAttrString(myPyModule , (char*)"isDraggable") ) { PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"isDraggable", - (char*)"s", what->entry().toLatin1().constData() ) ); + (char*)"s", what->entry().toUtf8().constData() ) ); if( !res || !PyBool_Check( res )) { PyErr_Print(); draggable = false; @@ -2681,7 +2681,7 @@ bool PyModuleHelper::internalIsDropAccepted( LightApp_DataObject* where ) if ( PyObject_HasAttrString(myPyModule , (char*)"isDropAccepted") ) { PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"isDropAccepted", - (char*)"s", where->entry().toLatin1().constData() ) ); + (char*)"s", where->entry().toUtf8().constData() ) ); if( !res || !PyBool_Check( res )) { PyErr_Print(); dropAccepted = false; @@ -2731,7 +2731,7 @@ void PyModuleHelper::internalDropObjects( const DataObjectList& what, SUIT_DataO if ( PyObject_HasAttrString(myPyModule, (char*)"dropObjects") ) { PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"dropObjects", (char*)"Osii", sipList.get(), - whereObject->entry().toLatin1().constData(), + whereObject->entry().toUtf8().constData(), row, action ) ); if( !res ) { @@ -2819,7 +2819,7 @@ void PyModuleHelper::internalOBClickedPython( const QString& theObj, int theColu return; // Error if ( PyObject_HasAttrString( myPyModule, (char*)"onObjectBrowserClicked" ) ) { - PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"onObjectBrowserClicked", (char*)"si", theObj.toLatin1().constData(), theColumn ) ); + PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"onObjectBrowserClicked", (char*)"si", theObj.toUtf8().constData(), theColumn ) ); if( !res ) { PyErr_Print(); } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx index 84e6e641c..c09598449 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx @@ -149,9 +149,9 @@ void SALOME_PYQT_Selector::getSelection(SUIT_DataOwnerPtrList& theList) const SALOME_PYQT_BorrowedDataObjectLight *obj = new SALOME_PYQT_BorrowedDataObjectLight(myLocalEntries[i]); #ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject)aSObj = new SALOME_InteractiveObject - ( obj->entry().toLatin1().constData(), + ( obj->entry().toUtf8().constData(), obj->componentDataType().toLatin1().constData(), - obj->name().toLatin1().constData() ); + obj->name().toUtf8().constData() ); LightApp_DataOwner* owner = new LightApp_DataOwner(aSObj); #else LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() ); diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 7169cc1b2..6b2eb96a0 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -177,7 +177,7 @@ namespace if ( app && !fileName.isEmpty() ) { QPixmap pixmap = app->resourceMgr()->loadPixmap( module, QApplication::translate( module.toLatin1().data(), - fileName.toLatin1().data() ) ); + fileName.toUtf8().data() ) ); if ( !pixmap.isNull() ) icon = QIcon( pixmap ); } diff --git a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx index 39e8e1f77..120927647 100644 --- a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx +++ b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx @@ -308,7 +308,7 @@ const char* SALOMEGUI_Swig::getSelected( int index ) { QStringList selected = ProcessEvent( new TGetSelectedEvent() ); return index >= 0 && index < selected.count() ? - strdup( selected[ index ].toLatin1().constData() ) : 0; + strdup( selected[ index ].toUtf8().constData() ) : 0; } /*! @@ -329,7 +329,7 @@ void SALOMEGUI_Swig::AddIObject( const char* theEntry ) LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); if ( aStudy && aSelMgr ) { SALOME_ListIO anIOList; - anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ); + anIOList.Append( new SALOME_InteractiveObject( myEntry.toUtf8(), "", "" ) ); aSelMgr->setSelectedObjects( anIOList, true ); } } @@ -364,7 +364,7 @@ void SALOMEGUI_Swig::RemoveIObject( const char* theEntry ) aSelMgr->selectedObjects( anIOList ); SALOME_ListIteratorOfListIO anIter( anIOList ); for( ; anIter.More(); anIter.Next() ) { - if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) { + if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toUtf8(), "", "" ) ) ) { anIOList.Remove( anIter ); aSelMgr->setSelectedObjects( anIOList, true ); return; @@ -605,7 +605,7 @@ public: if ( window ) { SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); if ( view ) { - SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() ); + SALOME_Prs* aPrs = view->CreatePrs( myEntry.toUtf8() ); myResult = !aPrs->IsNull(); } } @@ -898,7 +898,7 @@ public: const char* SALOMEGUI_Swig::getViewParameters() { QString result = ProcessEvent( new TGetViewParameters() ); - return result.isEmpty() ? 0 : strdup( result.toLatin1().constData() ); + return result.isEmpty() ? 0 : strdup( result.toUtf8().constData() ); } diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 3981d50cb..aa9ed64b2 100755 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -259,7 +259,7 @@ void SOCC_Viewer::rename( const Handle(SALOME_InteractiveObject)& obj, Handle(SALOME_InteractiveObject) IO = aSh->getIO(); if ( IO->isSame( obj ) ) { - aSh->setName( name.toLatin1().data() ); + aSh->setName( name.toUtf8().data() ); break; } } diff --git a/src/SPlot2d/SPlot2d_ViewModel.cxx b/src/SPlot2d/SPlot2d_ViewModel.cxx index f890ca74c..0d8250f24 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.cxx +++ b/src/SPlot2d/SPlot2d_ViewModel.cxx @@ -85,7 +85,7 @@ void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject, } if( aCurve && aCurve->hasTableIO() && aCurve->getTableIO()->isSame( IObject ) ) - aCurve->getTableIO()->setName( newName.toLatin1() ); + aCurve->getTableIO()->setName( newName.toUtf8() ); } aViewFrame->updateTitles(); } diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index e10fe4d75..0fd4f37db 100755 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -344,7 +344,7 @@ SUIT_Session::AppLib SUIT_Session::loadLibrary( const QString& name, QString& li return 0; AppLib lib = 0; - QByteArray bid = libFile.toLatin1(); + QByteArray bid = libFile.toUtf8(); #ifdef WIN32 #ifdef UNICODE LPTSTR str = (LPTSTR)libFile.utf16(); @@ -353,7 +353,7 @@ SUIT_Session::AppLib SUIT_Session::loadLibrary( const QString& name, QString& li #endif lib = ::LoadLibrary( str ); #else - lib = dlopen( (const char*)libFile.toLatin1(), RTLD_LAZY | RTLD_GLOBAL ); + lib = dlopen( (const char*)libFile.toUtf8(), RTLD_LAZY | RTLD_GLOBAL ); #endif return lib; } diff --git a/src/SUIT/SUIT_Tools.cxx b/src/SUIT/SUIT_Tools.cxx index 5c5595e13..09fc699b6 100755 --- a/src/SUIT/SUIT_Tools.cxx +++ b/src/SUIT/SUIT_Tools.cxx @@ -41,7 +41,7 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... ) tmpPath += QString( "Salome_trace" ); FILE* pStream; - pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toLatin1(), "a" ); + pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toUtf8(), "a" ); if ( pStream ) { va_list argptr; diff --git a/src/SUITApp/SUITApp_init_python.cxx b/src/SUITApp/SUITApp_init_python.cxx index 3724dd562..0a10ff7c7 100644 --- a/src/SUITApp/SUITApp_init_python.cxx +++ b/src/SUITApp/SUITApp_init_python.cxx @@ -67,7 +67,7 @@ void SUIT_PYTHON::init_python(int argc, char **argv) script += "import sys\n"; script += "sys.excepthook = _custom_except_hook\n"; script += "del _custom_except_hook, sys\n"; - int res = PyRun_SimpleString(qPrintable(script)); + int res = PyRun_SimpleString(qUtf8Printable(script)); // VSR (22/09/2016): end of workaround PyEval_InitThreads(); // Create (and acquire) the interpreter lock - can be called many times // Py_InitThreads acquires the GIL diff --git a/src/SVTK/SVTK_CubeAxesDlg.cxx b/src/SVTK/SVTK_CubeAxesDlg.cxx index 59a38d53d..8acdb8318 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.cxx +++ b/src/SVTK/SVTK_CubeAxesDlg.cxx @@ -149,7 +149,7 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor) // Name theActor->SetTitleVisibility(myNameGrp->isChecked() ? 1 : 0); - theActor->SetTitle(myAxisName->text().toLatin1()); + theActor->SetTitle(myAxisName->text().toUtf8()); QColor aTitleColor(255, 255, 255); int aTitleFontFamily = VTK_ARIAL; diff --git a/src/SVTK/SVTK_Recorder.cxx b/src/SVTK/SVTK_Recorder.cxx index 955849c94..3d9dc5cba 100755 --- a/src/SVTK/SVTK_Recorder.cxx +++ b/src/SVTK/SVTK_Recorder.cxx @@ -489,6 +489,6 @@ SVTK_Recorder ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL"; #endif - if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<SetName( (const char*)myFileName.toLatin1() ); + myRecorder->SetName( (const char*)myFileName.toUtf8() ); myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentIndex() == 0 ); myRecorder->SetNbFPS( myFPSSpinBox->value() ); diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 9ee31b180..495b26f60 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -335,7 +335,7 @@ SVTK_View ForEachIf(aCopy.GetActors(), TIsSameIObject(theIObject), TSetFunction - (&SALOME_Actor::setName,theName.toLatin1().data())); + (&SALOME_Actor::setName,theName.toUtf8().data())); } /*! diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index d13911d46..3a63b154f 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -678,7 +678,7 @@ void SVTK_ViewWindow::setBackground( const Qtx::BackgroundData& bgData ) aReader = vtkMetaImageReader::New(); if ( aReader ) { // create texture - aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() ); + aReader->SetFileName( fi.absoluteFilePath().toUtf8().constData() ); aReader->Update(); VTKViewer_Texture* aTexture = VTKViewer_Texture::New(); vtkImageMapToColors* aMap = 0; @@ -1421,7 +1421,7 @@ bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa QString aFilePrefix(fileName); QString anExtension(SUIT_Tools::extension(fileName)); aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length()); - anExporter->SetFilePrefix(aFilePrefix.toLatin1().data()); + anExporter->SetFilePrefix(aFilePrefix.toUtf8().data()); anExporter->Write(); anExporter->Delete(); } @@ -1648,7 +1648,7 @@ void setGradAxisVisualParams(QXmlStreamReader& reader, vtkAxisActor2D* actor) //printf("#### Color: %f, %f, %f\n", color[0], color[1], color[2]); actor->SetTitleVisibility( isVisible ); - actor->SetTitle( title.toLatin1() ); + actor->SetTitle( title.toUtf8() ); vtkTextProperty* txtProp = actor->GetTitleTextProperty(); if ( txtProp ) { txtProp->SetColor( color ); @@ -1733,7 +1733,7 @@ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params ) int shadow = paramsLst[10].toInt(); actor->SetTitleVisibility( isVisible ); - actor->SetTitle( title.toLatin1() ); + actor->SetTitle( title.toUtf8() ); vtkTextProperty* txtProp = actor->GetTitleTextProperty(); if ( txtProp ) { txtProp->SetColor( color ); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index eb93a7be7..5779f7b70 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1191,7 +1191,7 @@ int SalomeApp_Application::openChoice( const QString& aName ) } else { // file is not exist on disk SUIT_MessageBox::warning( desktop(), QObject::tr("WRN_WARNING"), - QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toLatin1().data())); + QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toUtf8().data())); return false; } diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 77a1ea824..b2adf0da8 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -254,7 +254,7 @@ void showTree( SUIT_DataObject* root ) { QString marg; marg.fill( ' ', 3*it.depth() ); QString nnn = "%1 '%2'"; - qDebug( nnn.arg( marg ).arg( it.current()->name() ).toLatin1() ); + qDebug( nnn.arg( marg ).arg( it.current()->name() ).toUtf8() ); } } @@ -286,7 +286,7 @@ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringLi if ( anId.isEmpty() ) return true; // Probably nothing to load - _PTR(SComponent) aSComp ( SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toLatin1() ) ) ); + _PTR(SComponent) aSComp ( SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toUtf8() ) ) ); if ( aSComp ) updateTree( aSComp, aDoc ); @@ -320,7 +320,7 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) studyRoot = dynamic_cast( aSStudy->root() ); QString anId = getRootEntry( aSStudy ); if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing - sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toLatin1() ) ); + sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toUtf8() ) ); } } } @@ -330,7 +330,7 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) aSStudy = dynamic_cast( studyRoot->study() ); // value should not change here theoretically, but just to make sure if ( aSStudy ) { // modelRoot->object() cannot be reused here: it is about to be deleted by buildTree() soon - sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( modelRoot->entry().toLatin1() ) ); + sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( modelRoot->entry().toUtf8() ) ); } } } diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index ba1afa068..2f4190519 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -291,7 +291,7 @@ QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) { LightApp_RootObject* aRoot = dynamic_cast( root() ); if ( aRoot && aRoot->study() ) { - CORBA::String_var data = aComponent->getObjectInfo( entry().toLatin1().constData()); + CORBA::String_var data = aComponent->getObjectInfo( entry().toUtf8().constData()); QString objInfo = data.in(); QStringList l; l << name(); diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index bf1ddf576..600e3a6dc 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -117,7 +117,7 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li val = valSO->GetName().c_str(); Handle( SALOME_InteractiveObject ) new_obj = - new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() ); + new SALOME_InteractiveObject( id.toUtf8(), comp.toLatin1(), val.toLatin1() ); dest.Append( new_obj ); } anIter->Next(); diff --git a/src/SalomeApp/SalomeApp_NoteBook.cxx b/src/SalomeApp/SalomeApp_NoteBook.cxx index 64d75941f..5467ef600 100644 --- a/src/SalomeApp/SalomeApp_NoteBook.cxx +++ b/src/SalomeApp/SalomeApp_NoteBook.cxx @@ -564,7 +564,7 @@ void NoteBook_Table::onItemChanged(QTableWidgetItem* theItem) if( myVariableMap.contains( anIndex ) ) { const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ]; - if( !aVariable.Name.isEmpty() && SalomeApp_Application::getStudy()->IsVariableUsed( std::string( aVariable.Name.toLatin1().constData() ) ) ) + if( !aVariable.Name.isEmpty() && SalomeApp_Application::getStudy()->IsVariableUsed( std::string( aVariable.Name.toUtf8().constData() ) ) ) { if( QMessageBox::warning( parentWidget(), tr( "WARNING" ), tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ), @@ -677,7 +677,7 @@ void NoteBook_Table::RemoveSelected() else { int nRow = row(aSelectedItems[i]); - if( aStudy->IsVariableUsed( std::string( aRow->GetName().toLatin1().constData() ) ) ) + if( aStudy->IsVariableUsed( std::string( aRow->GetName().toUtf8().constData() ) ) ) { if( QMessageBox::warning( parentWidget(), tr( "WARNING" ), tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ), @@ -695,7 +695,7 @@ void NoteBook_Table::RemoveSelected() myVariableMap.remove( index ); removeRow(nRow); myRows.removeAt(nRow); - if(aStudy->IsVariable(aVarName.toLatin1().constData())) + if(aStudy->IsVariable(aVarName.toUtf8().constData())) removedFromStudy = true; } } @@ -849,7 +849,7 @@ void SalomeApp_NoteBook::onApply() if( aVariableMapRef.contains( anIndex ) ) { QString aRemovedVariable = aVariableMapRef[ anIndex ].Name; - aStudy->RemoveVariable( std::string( aRemovedVariable.toLatin1().constData() ) ); + aStudy->RemoveVariable( std::string( aRemovedVariable.toUtf8().constData() ) ); } } @@ -871,22 +871,22 @@ void SalomeApp_NoteBook::onApply() if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName ) { - aStudy->RenameVariable( std::string( aNameRef.toLatin1().constData() ), - std::string( aName.toLatin1().constData() ) ); + aStudy->RenameVariable( std::string( aNameRef.toUtf8().constData() ), + std::string( aName.toUtf8().constData() ) ); } } if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) ) - aStudy->SetInteger(std::string(aName.toLatin1().constData()),anIVal); + aStudy->SetInteger(std::string(aName.toUtf8().constData()),anIVal); else if( NoteBook_TableRow::IsRealValue(aValue,&aDVal) ) - aStudy->SetReal(std::string(aName.toLatin1().constData()),aDVal); + aStudy->SetReal(std::string(aName.toUtf8().constData()),aDVal); else if( NoteBook_TableRow::IsBooleanValue(aValue,&aBVal) ) - aStudy->SetBoolean(std::string(aName.toLatin1().constData()),aBVal); + aStudy->SetBoolean(std::string(aName.toUtf8().constData()),aBVal); else - aStudy->SetString(std::string(aName.toLatin1().constData()),aValue.toStdString()); + aStudy->SetString(std::string(aName.toUtf8().constData()),aValue.toStdString()); } } myTable->ResetMaps(); diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index c438b2de8..8f3b4673a 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -365,7 +365,7 @@ private: while (o) { SalomeApp_DataObject* so = dynamic_cast( o ); if ( so ) { - std::string entry = so->entry().toLatin1().constData(); + std::string entry = so->entry().toUtf8().constData(); if ( entry.size() ) entry2SuitObject[entry] = so; } @@ -1138,7 +1138,7 @@ LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry { LightApp_DataObject* o = 0; if ( myObserver ) { - o = dynamic_cast( myObserver->findObject( theEntry.toLatin1().constData() ) ); + o = dynamic_cast( myObserver->findObject( theEntry.toUtf8().constData() ) ); } if ( !o ) { o = LightApp_Study::findObjectByEntry( theEntry ); diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index 807154003..aa4861f80 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -265,7 +265,7 @@ void VTKViewer_PolyDataMapper::SetBallEnabled( bool theBallEnabled ) QString anAlphaTexture = getenv( "GUI_ROOT_DIR" ); anAlphaTexture.append( "/share/salome/resources/gui/sprite_alpha.vti" ); - vtkSmartPointer aTextureValue = VTK::MakeTexture( aMainTexture.toLatin1().constData(), anAlphaTexture.toLatin1().constData() ); + vtkSmartPointer aTextureValue = VTK::MakeTexture( aMainTexture.toUtf8().constData(), anAlphaTexture.toUtf8().constData() ); this->SpecialTextures[BallTextureId] = aTextureValue; } this->ImageData = this->SpecialTextures[BallTextureId]; diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index d8bb673a0..ea0a597a9 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -553,7 +553,7 @@ void VTKViewer_ViewWindow::setBackground( const Qtx::BackgroundData& bgData ) aReader = vtkMetaImageReader::New(); if ( aReader ) { // create texture - aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() ); + aReader->SetFileName( fi.absoluteFilePath().toUtf8().constData() ); aReader->Update(); VTKViewer_Texture* aTexture = VTKViewer_Texture::New(); -- 2.30.2