diff options
author | Maurice Kalinowski <maurice.kalinowski@digia.com> | 2013-11-01 16:16:15 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-05 08:17:35 +0100 |
commit | 2ff0746e97acf37600b104838c96468f00953737 (patch) | |
tree | 9355da6854ad90ab38133d4d2133a3b5184c35fc /src/corelib/plugin | |
parent | af0409d336e07c61734777117f79906e0e82cd95 (diff) |
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 <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary_win.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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; |