Salome HOME
Small fix to process absolute file paths properly BR_new_bop3
authorvsr <vsr@opencascade.com>
Mon, 17 Jun 2013 06:54:02 +0000 (06:54 +0000)
committervsr <vsr@opencascade.com>
Mon, 17 Jun 2013 06:54:02 +0000 (06:54 +0000)
src/Qtx/QtxResourceMgr.cxx

index 2e06646cee95d144ba4446c0d41f9e8c878d39d7..669a16669153524ac25d74b2165f7d032c3c3b59 100644 (file)
@@ -334,15 +334,22 @@ const QtxResourceMgr::Section QtxResourceMgr::Resources::section( const QString&
 QString QtxResourceMgr::Resources::fileName( const QString& sect, const QString& prefix, const QString& name ) const
 {
   QString path;
-  if ( hasValue( sect, prefix ) )
+  if ( !QFileInfo( name ).isRelative() )
   {
-    path = value( sect, prefix, true );
-    if ( !path.isEmpty() )
+    path = name;
+  }
+  else
+  {
+    if ( hasValue( sect, prefix ) )
     {
-      if ( QFileInfo( path ).isRelative() )
-        path = Qtx::addSlash( Qtx::dir( myFileName, true ) ) + path;
-
-      path = Qtx::addSlash( path ) + name;
+      path = value( sect, prefix, true );
+      if ( !path.isEmpty() )
+      {
+       if ( QFileInfo( path ).isRelative() )
+         path = Qtx::addSlash( Qtx::dir( myFileName, true ) ) + path;
+       
+       path = Qtx::addSlash( path ) + name;
+      }
     }
   }
   if( !path.isEmpty() )