From 4bce2317e3648a3cf30bf767e74ca5113c89cad1 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 21 Aug 2007 13:45:57 +0000 Subject: [PATCH] *** empty log message *** --- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 133 +--------------------------- 1 file changed, 2 insertions(+), 131 deletions(-) diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index b39d1094e..e6262363b 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -60,132 +60,6 @@ typedef int PIXELS; #define SPACING_SIZE 6 #define MIN_SPIN_WIDTH 100 -static const char* SEPARATOR = ":"; - -/*! - \brief Add system-dependant slash to the end of path. - \internal - \param path path string to be extended by the slash - \return modified path string -*/ -static QString addSlash( const QString& path ) -{ - return Qtx::addSlash( path ); -} - -/*! - \brief Find file. - \internal - - The search of the file is done in the following order: - - ${HOME}/.salome/resources directory - - ${SALOME_SITE_DIR}/share/${SALOME_SITE_NAME}/resources - (SALOME_SITE_NAME defaults to the "salome") - - ${KERNEL_ROOT_DIR}/share/salome/resources/kernel directory - - ${GUI_ROOT_DIR}/share/salome/resources/gui directory - - ${CSF_SalomeResources} directory (it can be directory list, - separated by ":" symbol) - - \param filename file name - \return file path if it is found or null string otherwise -*/ -static QString findFile( QString filename ) -{ - QString dir; - char* cenv; - - // Try ${HOME}/.salome/resources directory - cenv = getenv( "HOME" ); - if ( cenv ) { - dir.sprintf( "%s", cenv ); - if ( !dir.isEmpty() ) { - dir = addSlash(dir) ; - dir = dir + ".salome" ; - dir = addSlash(dir) ; - dir = dir + "resources" ; - dir = addSlash(dir) ; - QFileInfo fileInfo( dir + filename ); - if ( fileInfo.isFile() && fileInfo.exists() ) - return fileInfo.filePath(); - } - } - // Try ${SALOME_SITE_DIR}/share/salome/resources directory - cenv = getenv( "SALOME_SITE_DIR" ); - if ( cenv ) { - dir.sprintf( "%s", cenv ); - if ( !dir.isEmpty() ) { - dir = addSlash(dir) ; - dir = dir + "share" ; - dir = addSlash(dir) ; - cenv = getenv("SALOME_SITE_NAME"); - if (cenv) dir = dir + cenv; - else dir = dir + "salome" ; - dir = addSlash(dir) ; - dir = dir + "resources" ; - dir = addSlash(dir) ; - QFileInfo fileInfo( dir + filename ); - if ( fileInfo.isFile() && fileInfo.exists() ) - return fileInfo.filePath(); - } - } - // Try ${KERNEL_ROOT_DIR}/share/salome/resources/kernel directory - cenv = getenv( "KERNEL_ROOT_DIR" ); - if ( cenv ) { - dir.sprintf( "%s", cenv ); - if ( !dir.isEmpty() ) { - dir = addSlash(dir) ; - dir = dir + "share" ; - dir = addSlash(dir) ; - dir = dir + "salome" ; - dir = addSlash(dir) ; - dir = dir + "resources" ; - dir = addSlash(dir) ; - dir = dir + "kernel" ; - dir = addSlash(dir) ; - QFileInfo fileInfo( dir + filename ); - if ( fileInfo.isFile() && fileInfo.exists() ) - return fileInfo.filePath(); - } - } - - // Try ${GUI_ROOT_DIR}/share/salome/resources/gui directory - cenv = getenv( "GUI_ROOT_DIR" ); - if ( cenv ) { - dir.sprintf( "%s", cenv ); - if ( !dir.isEmpty() ) { - dir = addSlash(dir) ; - dir = dir + "share" ; - dir = addSlash(dir) ; - dir = dir + "salome" ; - dir = addSlash(dir) ; - dir = dir + "resources" ; - dir = addSlash(dir) ; - dir = dir + "gui" ; - dir = addSlash(dir) ; - QFileInfo fileInfo( dir + filename ); - if ( fileInfo.isFile() && fileInfo.exists() ) - return fileInfo.filePath(); - } - } - - // Try CSF_SalomeResources env.var directory ( or directory list ) - cenv = getenv( "CSF_SalomeResources" ); - if ( cenv ) { - dir.sprintf( "%s", cenv ); - if ( !dir.isEmpty() ) - { - QStringList dirList = dir.split( SEPARATOR, QString::SkipEmptyParts ); // skip empty entries - for ( int i = 0; i < (int)dirList.count(); i++ ) - { - QFileInfo fileInfo( addSlash( dirList[ i ] ) + filename ); - if ( fileInfo.isFile() && fileInfo.exists() ) - return fileInfo.filePath(); - } - } - } - return filename; -} - #define BOLD( text ) ( QString( "" ) + QString( text ) + QString( "" ) ) static const char* const time_data[] = { @@ -626,11 +500,8 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent ) { setAttribute( Qt::WA_DeleteOnClose ); - QString aFile = findFile("default.png"); - - QPixmap pm ( aFile ); - if ( !pm.isNull() ) - setWindowIcon( pm ); + if ( parent ) + setWindowIcon( parent->windowIcon() ); // pixmap for buttons QPixmap image_refresh ( ( const char** ) refresh_data ); -- 2.39.2