diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2020-06-05 09:24:37 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2020-06-06 20:25:49 +0200 |
commit | 45b0f1be686cfba8dcecb9be5c875cae59c69276 (patch) | |
tree | 363dfd46575d147206267d854ce14747157f432e /src/corelib/plugin | |
parent | aa81b90738ce9faee5e433617c8bd243cb238729 (diff) |
Remove winrt
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.
Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary_win.cpp | 17 | ||||
-rw-r--r-- | src/corelib/plugin/qsystemlibrary.cpp | 10 |
2 files changed, 0 insertions, 27 deletions
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp index ef58724be8..ef1b389adc 100644 --- a/src/corelib/plugin/qlibrary_win.cpp +++ b/src/corelib/plugin/qlibrary_win.cpp @@ -63,10 +63,8 @@ QStringList QLibraryPrivate::prefixes_sys() bool QLibraryPrivate::load_sys() { -#ifndef Q_OS_WINRT //avoid 'Bad Image' message box UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); -#endif // We make the following attempts at locating the library: // // Windows @@ -91,22 +89,11 @@ bool QLibraryPrivate::load_sys() attempts.prepend(fileName); else attempts.append(fileName); -#ifdef Q_OS_WINRT - if (fileName.startsWith(QLatin1Char('/'))) - attempts.prepend(QDir::rootPath() + fileName); -#endif locker.unlock(); Handle hnd = nullptr; for (const QString &attempt : qAsConst(attempts)) { -#ifndef Q_OS_WINRT hnd = LoadLibrary(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(attempt).utf16())); -#else // Q_OS_WINRT - QString path = QDir::toNativeSeparators(QDir::current().relativeFilePath(attempt)); - hnd = LoadPackagedLibrary(reinterpret_cast<LPCWSTR>(path.utf16()), 0); - if (hnd) - qualifiedFileName = attempt; -#endif // !Q_OS_WINRT // If we have a handle or the last error is something other than "unable // to find the module", then bail out @@ -114,9 +101,7 @@ bool QLibraryPrivate::load_sys() break; } -#ifndef Q_OS_WINRT SetErrorMode(oldmode); -#endif locker.relock(); if (!hnd) { errorString = QLibrary::tr("Cannot load library %1: %2").arg( @@ -125,7 +110,6 @@ bool QLibraryPrivate::load_sys() // Query the actual name of the library that was loaded errorString.clear(); -#ifndef Q_OS_WINRT wchar_t buffer[MAX_PATH]; ::GetModuleFileName(hnd, buffer, MAX_PATH); @@ -147,7 +131,6 @@ bool QLibraryPrivate::load_sys() Q_ASSERT(!ok || hmod == hnd); Q_UNUSED(ok); } -#endif // !Q_OS_WINRT } pHnd.storeRelaxed(hnd); return (pHnd != nullptr); diff --git a/src/corelib/plugin/qsystemlibrary.cpp b/src/corelib/plugin/qsystemlibrary.cpp index 1a88476596..fe6760c8d8 100644 --- a/src/corelib/plugin/qsystemlibrary.cpp +++ b/src/corelib/plugin/qsystemlibrary.cpp @@ -72,14 +72,6 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_WINRT) -HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirectory /* = true */) -{ - Q_UNUSED(onlySystemDirectory); - return ::LoadPackagedLibrary(libraryName, 0); -} -#else - #if !defined(QT_BOOTSTRAPPED) extern QString qAppFileName(); #endif @@ -129,6 +121,4 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect } -#endif // Q_OS_WINRT - QT_END_NAMESPACE |