From c941f02e885cde9348926e7a2f8c248f6558e364 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 4 Jul 2006 14:03:21 +0000 Subject: [PATCH] Correct a bug: find appropriate user configuration file function does not return a file with nearest id. --- src/SUIT/SUIT_ResourceMgr.cxx | 2 +- src/Session/SALOME_Session_Server.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SUIT/SUIT_ResourceMgr.cxx b/src/SUIT/SUIT_ResourceMgr.cxx index 9a11288e3..018b6acf1 100755 --- a/src/SUIT/SUIT_ResourceMgr.cxx +++ b/src/SUIT/SUIT_ResourceMgr.cxx @@ -104,7 +104,7 @@ QString SUIT_ResourceMgr::findAppropriateUserFile( const QString& fname ) const if( id<0 ) continue; - if( abs( id-id0 ) < abs( appr-id0 ) ) + if( appr < 0 || abs( id-id0 ) < abs( appr-id0 ) ) { appr = id; appr_file = d.absFilePath( *anIt ); diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index d278421c1..fbc459a61 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -209,7 +209,8 @@ protected: int dev = dev1*100+dev2, id = major; id*=100; id+=minor; id*=100; id+=release; - id*=10000; id+=dev; + id*=10000; + if ( dev > 0 ) id+=dev-10000; return id; } -- 2.39.2