-using namespace std;
-// File : QAD_ResourceMgr.cxx
-// Created : UI team, 22.10.00
-// Descr : ResourceMgr QAD-based application
-// Author : UI team
-// Project : SALOME
-// Module : SALOMEGUI
-// Copyright : Open CASCADE
+// SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : QAD_ResourceMgr.cxx
+// Author : UI team
+// Module : SALOME
// $Header$
+using namespace std;
/*!
\class QAD_ResourceMgr QAD_ResourceMgr.h
\brief ResourceMgr QAD-based application.
Collects list of directories, separated by ';' where resources for module 'prefix'
can be situated
The order is following :
+ - <prefix>_ROOT_DIR/share/salome/resources directory
- CSF_<prefix>Resources env.var directory ( or directory list )
- - CSF_ResourcesDefaults env.var directory ( or directory list )
- ${HOME}/.salome/resources directory
- - ${SALOME_SITE_DIR}/share/salome/resources directory
- - ${SALOME_ROOT_DIR}/share/salome/resources directory
+ - KERNEL_ROOT_DIR/share/salome/resources directory
*/
QString QAD_ResourceMgr::collectDirs( const QString& prefix ) const
{
QString dir;
char* cenv;
+ if ( !prefix.isEmpty() ) {
+ envVar = prefix.latin1() + QCString( "_ROOT_DIR" );
+ cenv = getenv( ( const char* ) envVar );
+ if ( cenv ) {
+ dir.sprintf( "%s", cenv );
+ if ( !dir.isEmpty() ) {
+ dir = QAD_Tools::addSlash(dir) ;
+ dir = dir + "share" ;
+ dir = QAD_Tools::addSlash(dir) ;
+ 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 CSF_<prefix>Resources env.var directory ( or directory list )
if ( !prefix.isEmpty() ) {
envVar = QCString( "CSF_" ) + prefix.latin1() + QCString( "Resources" );
dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
}
}
- // Try CSF_ResourcesDefaults env.var directory ( or directory list )
- cenv = getenv( "CSF_ResourcesDefaults" );
- if ( cenv ) {
- dir.sprintf( "%s", cenv );
- if ( !dir.isEmpty() )
- dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
- }
// Try ${HOME}/.salome/resources directory
cenv = getenv( "HOME" );
if ( cenv ) {
dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
}
}
- // Try ${SALOME_SITE_DIR}/share/salome/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) ;
- 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 ${SALOME_ROOT_DIR}/share/salome/resources directory
- cenv = getenv( "SALOME_ROOT_DIR" );
+
+ // Try ${KERNEL_ROOT_DIR}/share/salome/resources directory
+ cenv = getenv( "KERNEL_ROOT_DIR" );
if ( cenv ) {
dir.sprintf( "%s", cenv );
if ( !dir.isEmpty() ) {