Skip to content
Permalink
Browse files

prepend / to path on win

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13003 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 5, 2010
1 parent 9697575 commit 851fc10e8b6d0741d04eaec438747312b938b19e
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/plugins/grass/qgis.g.browser.cpp
@@ -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,7 +18,15 @@ int main( int argc, char **argv )
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

0 comments on commit 851fc10

Please sign in to comment.
You can’t perform that action at this time.