Skip to content

Commit 851fc10

Browse files
author
rblazek
committedMar 5, 2010
prepend / to path on win
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13003 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎src/plugins/grass/qgis.g.browser.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#include <stdlib.h>
22
#include <stdio.h>
33
#include <unistd.h>
4+
#include <iostream>
45
#include <QUrl>
56
#include <QDesktopServices>
7+
#include <QString>
68

79
#ifdef Q_OS_WIN
810
#include <windows.h>
@@ -16,7 +18,15 @@ int main( int argc, char **argv )
1618
fprintf( stderr, "URL argument missing\n" );
1719
exit( 1 );
1820
}
19-
QDesktopServices::openUrl( QUrl( argv[1] ) );
21+
QUrl url ( argv[1] );
22+
#ifdef Q_OS_WIN
23+
// openUrl on windows fails to open 'file://c:...' it must be 'file:///c:...' (3 slashes)
24+
if ( url.scheme() == "file" ) {
25+
url.setPath ( "/" + url.path() );
26+
std::cout << "path reset to: " << qPrintable(url.path()) << std::endl;
27+
}
28+
#endif
29+
QDesktopServices::openUrl( url );
2030
#ifdef Q_OS_WIN
2131
Sleep( 1000 );
2232
#else

0 commit comments

Comments
 (0)
Please sign in to comment.