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>
This commit is contained in:
Andrew Knight 2014-03-16 20:28:39 +02:00 committed by The Qt Project
parent 9827f6d198
commit b63027867e

View File

@ -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;