Salome HOME
Load Qt resources properly: take into account QT_ROOT_DIR instead of (QTDIR)
authorvsr <vsr@opencascade.com>
Mon, 2 Feb 2015 16:04:38 +0000 (19:04 +0300)
committervsr <vsr@opencascade.com>
Mon, 2 Feb 2015 16:04:38 +0000 (19:04 +0300)
src/Qtx/QtxResourceMgr.cxx
src/SUITApp/SUITApp.cxx
src/Session/SALOME_Session_Server.cxx

index 7b2688844e0fffde3dd04e6eaec553a9ed2e19de..ccac83924bdcec06ce929744f7101394410c3d4a 100644 (file)
@@ -2697,9 +2697,9 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   if ( pref.isEmpty() && lang != "en" ) {
     // load Qt resources
     QString qt_translations = QLibraryInfo::location( QLibraryInfo::TranslationsPath );
-    QString qt_dir_trpath;
-    if ( ::getenv( "QTDIR" ) )
-      qt_dir_trpath = QString( ::getenv( "QTDIR" ) );
+    QString qt_dir_trpath = qgetenv( "QT_ROOT_DIR" );
+    if ( qt_dir_trpath.isEmpty() )
+      qt_dir_trpath = qgetenv( "QTDIR" );
     if ( !qt_dir_trpath.isEmpty() )
       qt_dir_trpath = QDir( qt_dir_trpath ).absoluteFilePath( "translations" );
 
index 861f9df0a55366a43a7cd936abee47e1d8fed62d..f3b8df360d53ba353dcad06a411327f2839cc25f 100644 (file)
@@ -178,7 +178,9 @@ int main( int argc, char* argv[] )
   }
 
   // add $QTDIR/plugins to the pluins search path for image plugins
-  QString qtdir( ::getenv( "QTDIR" ) );
+  QString qtdir = qgetenv( "QT_ROOT_DIR" );
+  if ( qtdir.isEmpty() )
+    qtdir = qgetenv( "QTDIR" );
   if ( !qtdir.isEmpty() )
     QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );
 
index dee5c66895c7fe46a6f93f80a5545400c6a34d67..70bf7038a55fb952f531dfb4e0af489e62f2ea0c 100755 (executable)
@@ -351,7 +351,9 @@ int main( int argc, char **argv )
   }
   
   // add $QTDIR/plugins to the pluins search path for image plugins
-  QString qtdir( ::getenv( "QTDIR" ) );
+  QString qtdir = qgetenv( "QT_ROOT_DIR" );
+  if ( qtdir.isEmpty() )
+    qtdir = qgetenv( "QTDIR" );
   if ( !qtdir.isEmpty() )
     QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );