summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qdesktopservices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util/qdesktopservices.cpp')
-rw-r--r--src/gui/util/qdesktopservices.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 77ccc02aa5..dfd190ddd0 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -226,8 +226,11 @@ bool QDesktopServices::openUrl(const QUrl &url)
qWarning("The platform plugin does not support services.");
return false;
}
- return url.scheme() == QLatin1String("file") ?
- platformServices->openDocument(url) : platformServices->openUrl(url);
+ // We only use openDocument if there is no fragment for the URL to
+ // avoid it being lost when using openDocument
+ if (url.isLocalFile() && !url.hasFragment())
+ return platformServices->openDocument(url);
+ return platformServices->openUrl(url);
}
/*!