summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-03-16 20:28:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 21:38:03 +0100
commitb63027867e6054da871c89a22b446730553872a2 (patch)
treed4f97279932f8bf08149251b9612e77e0e9cdb2b
parent9827f6d19817d2653ea4fbf5df30d7bb2fb6f787 (diff)
WinRT: Fix QDesktopServices::openUrl() for local files
The passed-in URL is expected to be a file-scheme URL to be converted to a QString using toLocalFile(), not a relative path to be prepended with the application directory. Change-Id: I647f351c99f0df66ef017936585f044292c16aff Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtservices.cpp b/src/plugins/platforms/winrt/qwinrtservices.cpp
index 8f0a1d55bb..73c090351b 100644
--- a/src/plugins/platforms/winrt/qwinrtservices.cpp
+++ b/src/plugins/platforms/winrt/qwinrtservices.cpp
@@ -106,8 +106,7 @@ bool QWinRTServices::openDocument(const QUrl &url)
if (!(m_fileFactory && m_launcher))
return QPlatformServices::openDocument(url);
- QString pathString = QDir::toNativeSeparators(
- QDir::cleanPath(qApp->applicationDirPath().append(url.toString(QUrl::RemoveScheme))));
+ const QString pathString = QDir::toNativeSeparators(url.toLocalFile());
HSTRING_HEADER header; HSTRING path;
WindowsCreateStringReference((const wchar_t*)pathString.utf16(), pathString.length(), &header, &path);
IAsyncOperation<StorageFile*> *fileOp;