[QGIS Commit] r11360 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Aug 12 16:07:44 EDT 2009


Author: homann
Date: 2009-08-12 16:07:44 -0400 (Wed, 12 Aug 2009)
New Revision: 11360

Modified:
   trunk/qgis/src/core/qgsmaplayer.cpp
Log:
Always use / for dir separator with QFileInfo. Fixes #1864

Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp	2009-08-12 15:08:22 UTC (rev 11359)
+++ trunk/qgis/src/core/qgsmaplayer.cpp	2009-08-12 20:07:44 UTC (rev 11360)
@@ -287,9 +287,12 @@
   {
     QFileInfo pfi( QgsProject::instance()->fileName() );
     QgsDebugMsg( "project path: " + pfi.canonicalPath() );
-    QgsDebugMsg( "src path: " + srcInfo.canonicalFilePath() + QDir::separator() );
-    if ( srcInfo.canonicalFilePath().startsWith( pfi.canonicalPath() + QDir::separator() ) )
+    QgsDebugMsg( "src path: " + srcInfo.canonicalFilePath() );
+    if ( srcInfo.canonicalFilePath().startsWith( pfi.canonicalPath() + "/" ) ) // QFileInfo always uses '/' for directory separator. 
+    {
       src = src.mid( pfi.canonicalPath().size() + 1 );
+      QgsDebugMsg( "use relative path: " + src );
+    }
   }
 
   QDomText dataSourceText = document.createTextNode( src );



More information about the QGIS-commit mailing list