summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-20 09:58:29 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-20 10:54:29 (GMT)
commit2352454bdcc33f5914a245fd318e1591c3301711 (patch)
tree721008de61e3916d920eeab61149a62d41a3b24c /src/gui/util
parent9582eefb6004207028d3d50dbeffa2279aa55bbd (diff)
downloadQt-2352454bdcc33f5914a245fd318e1591c3301711.zip
Qt-2352454bdcc33f5914a245fd318e1591c3301711.tar.gz
Qt-2352454bdcc33f5914a245fd318e1591c3301711.tar.bz2
QDesktopServices::openUrl failed for local file paths with a file schema
OpenUrl couldn't open relative urls because we were passing 'file:///' schema to the ShellExecute on Windows Reviewed-by: Prasanth Ullattil # with '#' will be ignored, and an empty message aborts the commit.
Diffstat (limited to 'src/gui/util')
-rw-r--r--src/gui/util/qdesktopservices_win.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index 00cb4ae..dc016b6 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -66,8 +66,10 @@ static bool openDocument(const QUrl &file)
{
if (!file.isValid())
return false;
-
- quintptr returnValue = (quintptr)ShellExecute(0, 0, (wchar_t*)file.toString().utf16(), 0, 0, SW_SHOWNORMAL);
+ QString filePath = file.toLocalFile();
+ if (filePath.isEmpty()
+ filePath = file.toString();
+ quintptr returnValue = (quintptr)ShellExecute(0, 0, (wchar_t*)filePath.utf16(), 0, 0, SW_SHOWNORMAL);
return (returnValue > 32); //ShellExecute returns a value greater than 32 if successful
}