Salome HOME
Merge branch 'V7_dev' into V8_0_0_BR
[modules/gui.git] / src / SUIT / SUIT_ResourceMgr.cxx
index fd4e7b72d1da197c0feddf5b5c3578496d1c33e9..86dbf2959b2d90b10af24801463d440f47cfe553 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -21,6 +21,7 @@
 //
 
 #include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
 
 #include <QDir>
 #include <QFileInfo>
@@ -81,11 +82,12 @@ QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l
 {
   QString pathName;
 
-  QStringList arguments = QApplication::arguments();
+  QStringList arguments;
+  if ( SUIT_Session::session() ) arguments = SUIT_Session::session()->arguments();
   // Try config file, given in arguments
   for (int i = 1; i < arguments.count(); i++) {
     QRegExp rx ("--resources=(.+)");
-    if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 1 ) {
+    if ( rx.indexIn( arguments[i] ) >= 0 && rx.captureCount() > 0 ) {
       QString file = rx.cap(1);
       QFileInfo fi (file);
       pathName = fi.absoluteFilePath();