[QGIS Commit] r13003 - trunk/qgis/src/plugins/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Mar 5 07:08:33 EST 2010


Author: rblazek
Date: 2010-03-05 07:08:32 -0500 (Fri, 05 Mar 2010)
New Revision: 13003

Modified:
   trunk/qgis/src/plugins/grass/qgis.g.browser.cpp
Log:
prepend / to path on win

Modified: trunk/qgis/src/plugins/grass/qgis.g.browser.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgis.g.browser.cpp	2010-03-05 11:02:18 UTC (rev 13002)
+++ trunk/qgis/src/plugins/grass/qgis.g.browser.cpp	2010-03-05 12:08:32 UTC (rev 13003)
@@ -1,8 +1,10 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <iostream>
 #include <QUrl>
 #include <QDesktopServices>
+#include <QString>
 
 #ifdef Q_OS_WIN
 #include <windows.h>
@@ -16,8 +18,16 @@
     fprintf( stderr, "URL argument missing\n" );
     exit( 1 );
   }
-  QDesktopServices::openUrl( QUrl( argv[1] ) );
+  QUrl url ( argv[1] );
 #ifdef Q_OS_WIN
+  // openUrl on windows fails to open 'file://c:...' it must be 'file:///c:...' (3 slashes)
+  if ( url.scheme() == "file" ) {
+    url.setPath ( "/" + url.path() );
+    std::cout << "path reset to: " << qPrintable(url.path()) << std::endl;
+  }
+#endif
+  QDesktopServices::openUrl( url );
+#ifdef Q_OS_WIN
   Sleep( 1000 );
 #else
   sleep( 1 ); // not nice but if it exits immediately the page sometimes does not open



More information about the QGIS-commit mailing list