From f6b37c72def5ea1aaaa2635896993a3c797f1f0e Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 14 Oct 2011 13:19:45 +0000 Subject: [PATCH] Issue 0021360: EDF 1954 ALL: Possibility to change the title of the Salome main windows --- src/Session/SALOME_Session_Server.cxx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 3ce58ab5b..1318dc25f 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -199,6 +199,7 @@ protected: virtual int userFileId( const QString& _fname ) const { + int id = -1; if ( !myExtAppName.isEmpty() ) { QRegExp exp( QString( "\\.%1rc\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ) ); QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" ); @@ -207,25 +208,26 @@ protected: if( exp.exactMatch( fname ) ) { QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts ); int major=0, minor=0; - major = vers[0].toInt(); - minor = vers[1].toInt(); - if( vers_exp.indexIn( vers[2] )==-1 ) - return -1; int release = 0, dev1 = 0, dev2 = 0; - release = vers_exp.cap( 1 ).toInt(); - dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1(); - dev2 = vers_exp.cap( 3 ).toInt(); + if ( vers.count() > 0 ) major = vers[0].toInt(); + if ( vers.count() > 1 ) minor = vers[1].toInt(); + if ( vers.count() > 2 ) { + if( vers_exp.indexIn( vers[2] ) != -1 ) { + release = vers_exp.cap( 1 ).toInt(); + dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1(); + dev2 = vers_exp.cap( 3 ).toInt(); + } + } - int dev = dev1*100+dev2, id = major; + int dev = dev1*100+dev2; + id = major; id*=100; id+=minor; id*=100; id+=release; id*=10000; if ( dev > 0 ) id+=dev-10000; - return id; } } - - return -1; + return id; } public: -- 2.39.2