From 2ff0746e97acf37600b104838c96468f00953737 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 1 Nov 2013 16:16:15 +0100 Subject: Refactor plugin loading for WinRT Specify the root directory to be the package root. Only plugins inside the root can be opened (actually also only files). Furthermore current defaults to the package root now, which in most cases is identical to previous behavior. When attempting to load a plugin the path can either be specified in host format "C:/..." or as plugin absolute "/platforms/...". Check for both, with preference of latter case, like when qt.conf is used with / being used as plugin path. Change-Id: I7e3da293362488b62a3357c4882ebf5e048dcf95 Reviewed-by: Friedemann Kleint Reviewed-by: Andrew Knight Reviewed-by: Oliver Wolff --- src/corelib/plugin/qlibrary_win.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/plugin/qlibrary_win.cpp') diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp index 928f2c5eb1..b9494a3041 100644 --- a/src/corelib/plugin/qlibrary_win.cpp +++ b/src/corelib/plugin/qlibrary_win.cpp @@ -107,12 +107,16 @@ bool QLibraryPrivate::load_sys() attempts.append(QFileInfo(fileName).absoluteFilePath()); #endif } +#ifdef Q_OS_WINRT + if (fileName.startsWith(QLatin1Char('/'))) + attempts.prepend(QDir::rootPath() + fileName); +#endif Q_FOREACH (const QString &attempt, attempts) { #ifndef Q_OS_WINRT pHnd = LoadLibrary((wchar_t*)QDir::toNativeSeparators(attempt).utf16()); #else // Q_OS_WINRT - QString path = QDir::toNativeSeparators(QDir::current().relativeFilePath(fileName)); + QString path = QDir::toNativeSeparators(QDir::current().relativeFilePath(attempt)); pHnd = LoadPackagedLibrary((LPCWSTR)path.utf16(), 0); if (pHnd) qualifiedFileName = attempt; -- cgit v1.2.3