Salome HOME
Unicode support: correct handling of unicode on GUI level
authorrnv <rnv@opencascade.com>
Mon, 22 Jan 2018 08:54:45 +0000 (11:54 +0300)
committerrnv <rnv@opencascade.com>
Mon, 22 Jan 2018 08:54:45 +0000 (11:54 +0300)
43 files changed:
src/CAM/CAM_Application.cxx
src/GLViewer/GLViewer_Object.cxx
src/GLViewer/GLViewer_Viewer2d.cxx
src/HelpBrowser/HelpBrowser.cxx
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Displayer.cxx
src/LightApp/LightApp_Driver.cxx
src/LightApp/LightApp_OBSelector.cxx
src/LightApp/LightApp_Plot2dSelector.cxx
src/LightApp/LightApp_SelectionMgr.cxx
src/LightApp/LightApp_Study.cxx
src/LightApp/LightApp_VTKSelector.cxx
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx
src/OCCViewer/OCCViewer_CubeAxesDlg.cxx
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/Plot2d/Plot2d_AnalyticalParser.cxx
src/Qtx/Qtx.cxx
src/Qtx/QtxToolBar.cxx
src/Qtx/QtxWorkstack.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SALOME_SWIG/SALOMEGUI_Swig.cxx
src/SOCC/SOCC_ViewModel.cxx
src/SPlot2d/SPlot2d_ViewModel.cxx
src/SUIT/SUIT_Session.cxx
src/SUIT/SUIT_Tools.cxx
src/SUITApp/SUITApp_init_python.cxx
src/SVTK/SVTK_CubeAxesDlg.cxx
src/SVTK/SVTK_Recorder.cxx
src/SVTK/SVTK_RecorderDlg.cxx
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_ViewWindow.cxx
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_DataModel.cxx
src/SalomeApp/SalomeApp_DataObject.cxx
src/SalomeApp/SalomeApp_Module.cxx
src/SalomeApp/SalomeApp_NoteBook.cxx
src/SalomeApp/SalomeApp_Study.cxx
src/VTKViewer/VTKViewer_PolyDataMapper.cxx
src/VTKViewer/VTKViewer_ViewWindow.cxx

index ad486649262dbb5009e8241de90a26bdf5fa33f3..7721f9f62f1568d1bbb7af9bab8a360ec6a4d432 100755 (executable)
@@ -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
index 99ba4263d47d6d4b62cead1f98e13f0e9a475853..fa54128d72b893d4bfc7bc77c445d94b40d9d0f7 100644 (file)
@@ -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();
index b91b6248a06ee626798685744e943e25b998d576..e79b9f3a54c1f1d81774a81b99c057af7dff5549 100644 (file)
@@ -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 );
index be650d8eb2e061f602bc7389d0c993f9d0db204e..9848af0baa1c37bf2bfee3b0d31eab977a313def 100644 (file)
@@ -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;
index a649d14fa51657c8fda32c6e53efc907e91d1b4e..c451c3734a8038a115ae768e6d1d90b9e5be1fa1 100644 (file)
@@ -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 );
index a490d9c88aea278dca564de494ef5eaa5e16e9b7..fd9d54ea61d436d394e60ed141b98a5cb9acb9d3 100644 (file)
@@ -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;
 }
index dd51220bf23038234046c9081fd4bd95081b8eb2..957af1f870dc6987ce980260570479af829dc140 100644 (file)
@@ -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();
index 7eb1399e8cfe43b221284ab0bb031799106432e1..b325a094a47fdafdf541df69823f198b194aaf23 100644 (file)
@@ -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() );
index 8b754fb695b453144724105003309d77e89d14e0..f903cb5dafc121ea7016b73247119efa9697f0ce 100755 (executable)
@@ -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()),"","") );
       }      
     }
   }
index 9b0eafe5c4c1aa31bf60a95c97890d9a1d28a333..89875ec57bb9eb6c88abeb4303fd035a8b054f62 100644 (file)
@@ -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 );
       }
     }
   }
index debdb25b4d3eafdfdef8c7ac3f0c14a9955b7f0f..ba9a851965e53d5f398735eaf3e76eef0177a1b1 100644 (file)
@@ -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;
 }
 
index c5f81eecb1236625d3b74157b64c709ebfb34488..70db9624fa29aab715200b7910c4fbb30dfb4e8d 100644 (file)
@@ -238,7 +238,7 @@ LightApp_VTKSelector
               aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
             }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
               Handle(SALOME_InteractiveObject) anIO = 
-                new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
+                new SALOME_InteractiveObject(anOwner->entry().toUtf8(),"");
               aSelector->AddIObject(anIO);
               anAppendList.Append(anIO);
             }
index 4c4ae27b09369e94a876730f2088b5ea664ca9ac..f7544f9df61f51196c8fe0e07bffc25811ddd5ce 100755 (executable)
@@ -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();
 }
 
 /*!
index 992e4a5d5f4212ea4a45b4a25077e5f9cbec4958..86c919b99148fe2ef79e68e9628e046139c7db70 100644 (file)
@@ -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);
index cdf1edfe98781c1d2aaa752d5d7a6589a12f2d45..73f89e2137839f024228ee8851d135612ebcb3ff 100755 (executable)
@@ -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;
index 367c85151807567dc087def4d21d21378515669f..3f3217a96fe2cf9ee29010857aedb957a7d0f215 100644 (file)
@@ -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 {
index 09f963b80935a21f1d8deed5b5bfd953d39ec540..a8de35e8268d54f2da1ff84c683dcba8c11f96b7 100755 (executable)
@@ -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();
index 0fe626c72be3b9b63541fdce106925ac203f2d99..8d98abdb5f8977230b0d71880ec88eb592d24033 100755 (executable)
@@ -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() )
       {
index 5840e99850c1327b7a0c05fadd23320e06353f81..8216084c254b51b9658b3d7cc0aafdd5b2caac7b 100644 (file)
@@ -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 );
   }
 }
index 9de0de4c71648c325151c48f0b81eabb0a731fa8..8ae7b61586b65473effb07118a84f1ecd79d7929 100644 (file)
@@ -884,7 +884,7 @@ bool QtxWorkstackArea::restoreState( QDataStream& stream, QMap<QString, QtxWorks
     QtxWorkstackChild* c = map.contains( name ) ? map[name] : 0;
     if ( !c )
     {
-      qWarning( "QtxWorkstack: Restored child widget \"%s\" not found.", (const char*)name.toLatin1() );
+      qWarning( "QtxWorkstack: Restored child widget \"%s\" not found.", (const char*)name.toUtf8() );
       return false;
     }
 
@@ -3127,7 +3127,7 @@ bool QtxWorkstack::restoreState( QDataStream& stream )
 
       map.insert( c->widget()->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() );
     }
   }
 
index 99e4222e00224399d8faab6577b5a22217dfd96f..5163fcc14e09f13b3db113f233b7addb4bfa6d82 100644 (file)
@@ -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();
index ce5f82caf5df1fc2dc56a52627c726091e380a8c..787d8d5fd7ddac32cc8ade196663c42ece540f68 100644 (file)
@@ -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();
     }
index 84e6e641c70c54bc893bbf195af3277b0aee2841..c0959844994add0685a75d69cdb6a619b5c02fd5 100644 (file)
@@ -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() );
index 7169cc1b2f862448a1daf93a93f23b4b1099510f..6b2eb96a08170e97da444888e37d96bcf814f7b9 100644 (file)
@@ -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 );
     }
index 39e8e1f77d4736df99ada097214f8346a84d8e57..1209276473cbefb0f2bfdfa543be7c429b2613dd 100644 (file)
@@ -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<SALOME_View*>( 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() );  
 }
 
 
index 3981d50cb38a676e4053c042453ff10450085f09..aa9ed64b2ae762a1e6ff5c917690352d20bc55fa 100755 (executable)
@@ -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;
         }
       }
index f890ca74cf19fe2622e92832d55414e857670587..0d8250f24822a3322f53d1bee0caac6b8a493205 100644 (file)
@@ -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();
 }
index e10fe4d75a7689b72dbf5988598a132de6e80fab..0fd4f37dbcaf20c9421cc3bf6637587e79a997e0 100755 (executable)
@@ -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;
 }
index 5c5595e1343b1a3246a93b84bc9f1826858d25c9..09fc699b628506569959c302e240df197ff35488 100755 (executable)
@@ -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;
index 3724dd562f3ecacc73f235f0909820712faed73c..0a10ff7c7b0247a7ec94d0b8030090dc225e0bbe 100644 (file)
@@ -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
index 59a38d53d9a63748b732425835c0776a85f2d4e5..8acdb83185548c3f04f8877c82e0b9da1a36d001 100644 (file)
@@ -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;
index 955849c948c1fdb08230fe1c39fd8971d6a65941..3d9dc5cbaf3dda7d2b802129714aa7c86425e7c0 100755 (executable)
@@ -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()<<endl;
-  system((const char*)aCommand.toLatin1());
+  if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toUtf8()<<endl;
+  system((const char*)aCommand.toUtf8());
 }
index 695befdf3dde7839be47fac5798a89dbf042444e..366e70aed347105e1a9d4ab27bab44509300f12a 100644 (file)
@@ -130,7 +130,7 @@ void SVTK_RecorderDlg::onStart()
   if( myFileName.isNull() )
     return;
 
-  myRecorder->SetName( (const char*)myFileName.toLatin1() );
+  myRecorder->SetName( (const char*)myFileName.toUtf8() );
 
   myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentIndex() == 0 );
   myRecorder->SetNbFPS( myFPSSpinBox->value() );
index 9ee31b1803a78f48ecd3696248ec22f6d7a4e0a3..495b26f6056d8e3ff92b5cd05a9908f99dd60f19 100644 (file)
@@ -335,7 +335,7 @@ SVTK_View
   ForEachIf<SALOME_Actor>(aCopy.GetActors(),
                           TIsSameIObject<SALOME_Actor>(theIObject),
                           TSetFunction<SALOME_Actor,const char*,const char*>
-                          (&SALOME_Actor::setName,theName.toLatin1().data()));
+                          (&SALOME_Actor::setName,theName.toUtf8().data()));
 }
 
 /*!
index d13911d460eea075006e46f335365169f52bdb1a..3a63b154fb6b911ba5061346828a6bb8f95dab44 100755 (executable)
@@ -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 );
index eb93a7be75d38d6d969e4296d5d2fbd3f74f6936..5779f7b706617fc564186dabe6a896af75c40b20 100644 (file)
@@ -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;
   }
 
index 77a1ea8248d328ac7b45b778bdf60910dbdb9376..b2adf0da81555ebaa5d3f3cc6df7ebd168007c6f 100644 (file)
@@ -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<LightApp_RootObject*>( 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<SalomeApp_Study*>( studyRoot->study() ); // <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() ) );
       }
     }
   }
index ba1afa06889fba0deb77023616d24266422a9d22..2f41905198aeed9fb2400cabfe8f8daeef4b6e24 100644 (file)
@@ -291,7 +291,7 @@ QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const
       if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) {
         LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( 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();
index bf1ddf57602e000f544e0a7cb63536ce01839a89..600e3a6dc8c2470917b576a7d7b4cc66a4a09cc6 100644 (file)
@@ -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();
index 64d75941f1a2bc7996fd903d6e258720d1c8e282..5467ef600ae5e70bb5d5bf8d48d6feb9bb3a1a47 100644 (file)
@@ -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();
index c438b2de84c9c765660b3b26b2c5ea70aca83d67..8f3b4673a8b4f13db14a4a916187420851e49261 100644 (file)
@@ -365,7 +365,7 @@ private:
     while (o) {
       SalomeApp_DataObject* so = dynamic_cast<SalomeApp_DataObject*>( 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<LightApp_DataObject*>( myObserver->findObject( theEntry.toLatin1().constData() ) );
+    o = dynamic_cast<LightApp_DataObject*>( myObserver->findObject( theEntry.toUtf8().constData() ) );
   }
   if ( !o ) {
     o = LightApp_Study::findObjectByEntry( theEntry );
index 8071540037eae583e63a350f81af3887cded6407..aa4861f806508e25910d97ae53273c0c814f9ccb 100644 (file)
@@ -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<vtkImageData> aTextureValue = VTK::MakeTexture( aMainTexture.toLatin1().constData(), anAlphaTexture.toLatin1().constData() );
+      vtkSmartPointer<vtkImageData> aTextureValue = VTK::MakeTexture( aMainTexture.toUtf8().constData(), anAlphaTexture.toUtf8().constData() );
       this->SpecialTextures[BallTextureId] = aTextureValue;
     }
     this->ImageData = this->SpecialTextures[BallTextureId];
index d8bb673a005e5a7fe5d3c88580df4e84afb77a69..ea0a597a9a4187ddc19bf2ff1018d715eb5cf6f5 100755 (executable)
@@ -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();