Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / SALOMEGUI / QAD_ResourceMgr.cxx
index f6e5b6e8feb1b3290a4e61fa1bf0194eb906e382..576c7475c1c094eab92d59636d7da4a33b64715e 100644 (file)
@@ -26,7 +26,6 @@
 //  Module : SALOME
 //  $Header$
 
-using namespace std;
 /*!
   \class QAD_ResourceMgr QAD_ResourceMgr.h
   \brief ResourceMgr QAD-based application.
@@ -46,6 +45,7 @@ using namespace std;
 #include <qfileinfo.h>
 
 #include <Standard.hxx>
+using namespace std;
 
 /* configuration file */
 static const char* CONFIG_FILE = "config";
@@ -264,7 +264,8 @@ QString QAD_ResourceMgr::resources( const char* prefix ) const
   - <prefix>_ROOT_DIR/share/salome/resources directory
   - SALOME_<prefix>Resources env.var directory ( or directory list )
   - ${HOME}/.salome/resources directory
-  - KERNEL_ROOT_DIR/share/salome/resources directory
+  - ${SALOME_SITE_DIR}/share/${SALOME_SITE_NAME}/resources directory (for SALOME-based applications)
+  - ${KERNEL_ROOT_DIR}/share/salome/resources directory
 */
 QString QAD_ResourceMgr::collectDirs( const QString& prefix ) const
 {
@@ -314,7 +315,25 @@ QString QAD_ResourceMgr::collectDirs( const QString& prefix ) const
       dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
     }
   }
-
+  // Try ${SALOME_SITE_DIR}/share/${SALOME_SITE_NAME}/resources directory
+  cenv = getenv( "SALOME_SITE_DIR" );
+  if ( cenv ) {
+    dir.sprintf( "%s", cenv );
+    if ( !dir.isEmpty() ) {
+      dir = QAD_Tools::addSlash(dir) ;
+      dir = dir + "share" ;
+      dir = QAD_Tools::addSlash(dir) ;
+      cenv = getenv( "SALOME_SITE_NAME" );
+      if ( cenv ) 
+       dir = dir + cenv ;
+      else
+       dir = dir + "salome" ;
+      dir = QAD_Tools::addSlash(dir) ;
+      dir = dir + "resources" ;
+      dir = QAD_Tools::addSlash(dir) ;
+      dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
+    }
+  }
   // Try ${KERNEL_ROOT_DIR}/share/salome/resources directory
   cenv = getenv( "KERNEL_ROOT_DIR" );
   if ( cenv ) {