Skip to content

Commit

Permalink
prepend / to path on win
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@13003 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 5, 2010
1 parent 0880ab8 commit ad7b800
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion 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>
Expand All @@ -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
Expand Down

0 comments on commit ad7b800

Please sign in to comment.