From 26fed3d25b50c3fd681172979f15eb053f565465 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 10 Apr 2012 08:16:59 +0000 Subject: [PATCH] Correct the way application name and version is specified. --- src/LightApp/LightApp_Application.cxx | 29 +++++++-------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index c8ea9a9f5..1b3f0b958 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -56,6 +56,8 @@ #include "LightApp_WgViewModel.h" #include "LightApp_FullScreenHelper.h" + +#include #include #include @@ -381,7 +383,10 @@ void LightApp_Application::start() /*!Gets application name.*/ QString LightApp_Application::applicationName() const { - return tr( "APP_NAME" ); + static QString _app_name; + if ( _app_name.isEmpty() ) + _app_name = tr( "APP_NAME" ); + return _app_name; } /*!Gets application version.*/ @@ -398,27 +403,7 @@ QString LightApp_Application::applicationVersion() const } else { - QString path( ::getenv( "GUI_ROOT_DIR" ) ); - if ( !path.isEmpty() ) - path += QDir::separator(); - path += QString( "bin/salome/VERSION" ); - - QFile vf( path ); - if ( vf.open( QIODevice::ReadOnly ) ) - { - QString line( vf.readLine( 1024 ) ); - vf.close(); - - if ( !line.isEmpty() ) - { - while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) ) - line.remove( line.length() - 1, 1 ); - - int idx = line.lastIndexOf( ":" ); - if ( idx != -1 ) - _app_version = line.mid( idx + 1 ).trimmed(); - } - } + _app_version = GUI_VERSION_STR; } } return _app_version; -- 2.39.2