From d89af5316ec518cc88a683417cd712a51116f558 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Mon, 18 Nov 2024 19:37:14 +0100 Subject: [PATCH] refactor: Remove unused code This was only used for Qt 5.8 on Win. --- src/misc/dbus.cpp | 22 ---------------------- src/misc/dbus.h | 9 +-------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/misc/dbus.cpp b/src/misc/dbus.cpp index e7f3ae319..e317f98c1 100644 --- a/src/misc/dbus.cpp +++ b/src/misc/dbus.cpp @@ -3,28 +3,6 @@ #include "misc/dbus.h" -#ifdef Q_OS_WIN -# include - -# include - -// https://blogs.msdn.microsoft.com/oldnewthing/20131105-00/?p=2733 -// See https://bugreports.qt.io/browse/QTBUG-53031 for more details -// why this is necessary. -void preventQtDBusDllUnload() -{ - // Only Qt 5.8.0 is affected. - if (qVersion() != QByteArray("5.8.0")) { return; } - - static HMODULE dbusDll; - GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN, - reinterpret_cast(&QDBusConnection::staticMetaObject), &dbusDll); - Q_ASSERT(dbusDll); -} -#else -void preventQtDBusDllUnload() {} -#endif - QDBusArgument &operator<<(QDBusArgument &arg, const std::string &s) { arg.beginStructure(); diff --git a/src/misc/dbus.h b/src/misc/dbus.h index b2783714b..4151d8325 100644 --- a/src/misc/dbus.h +++ b/src/misc/dbus.h @@ -78,11 +78,4 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, QFlags &value) return arg; } -// *INDENT-ON* - -//! Windows: prevents unloading of QtDBus shared library until the process is terminated. -//! QtDBus must have been loaded already by the calling process. -//! Does nothing on non-Windows platforms. -SWIFT_MISC_EXPORT void preventQtDBusDllUnload(); - -#endif // guard +#endif // SWIFT_MISC_DBUS_H