Salome HOME
Updated copyright comment
[modules/gui.git] / src / SUIT / SUIT_Session.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 7946bf4..33e1390
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -53,22 +53,6 @@ SUIT_Session::SUIT_Session()
   mySession = this;
 }
 
-SUIT_Session::SUIT_Session( int argc, char** argv )
-: QObject(),
-  myResMgr( 0 ),
-  myActiveApp( 0 ),
-  myHandler( 0 ),
-  myExitStatus( NORMAL ),
-  myExitFlags ( 0 )
-{
-  SUIT_ASSERT( !mySession )
-
-  mySession = this;
-
-  for ( int i = 0; i < argc; i++ )
-    myArguments << QString( argv[i] );
-}
-
 /*!destructor. Clear applications list and set mySession to zero.*/
 SUIT_Session::~SUIT_Session()
 {
@@ -85,17 +69,6 @@ SUIT_Session::~SUIT_Session()
   mySession = 0;
 }
 
-/*!
-  Get arguments of the current session
- */
-QStringList SUIT_Session::arguments()
-{
-  QStringList r;
-  if ( !myArguments.isEmpty() ) r = myArguments;
-  else if ( QApplication::instance() ) r = QApplication::arguments();
-  return r;
-}
-
 /*! \retval return mySession */
 SUIT_Session* SUIT_Session::session()
 {
@@ -324,7 +297,11 @@ QString SUIT_Session::lastError() const
   ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
                    FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 );
   LPTSTR msg = (LPTSTR)lpMsgBuf;
+#ifdef UNICODE
+  str = QString::fromWCharArray(msg);
+#else
   str = QString( SUIT_Tools::toQString( msg ) );
+#endif
   LocalFree( lpMsgBuf );
 #else
   str = QString( dlerror() );
@@ -344,7 +321,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 +330,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;
 }
@@ -385,4 +362,4 @@ SUIT_ResourceMgr* SUIT_Session::createResourceMgr( const QString& appName ) cons
 void SUIT_Session::onApplicationActivated( SUIT_Application* app ) 
 {
   myActiveApp = app;
-}
+}
\ No newline at end of file