From b63027867e6054da871c89a22b446730553872a2 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Sun, 16 Mar 2014 20:28:39 +0200 Subject: 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 Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrtservices.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/plugins/platforms/winrt/qwinrtservices.cpp') 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 *fileOp; -- cgit v1.2.3