From 35ec9b87a72ad9345fd287b0911957f4eb135e44 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 24 Aug 2021 18:40:57 +0200 Subject: [PATCH] Port away from KPluginMetaData::instantiate It's deprecated according to the documentation, QPluginLoader works just as well (it's what kcoreaddons was using anyway). --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ead9b7914a..f9c52d58c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -583,7 +583,8 @@ QProcessEnvironment Application::processStartupEnvironment() const void Application::initPlatform(const KPluginMetaData &plugin) { Q_ASSERT(!m_platform); - m_platform = qobject_cast(plugin.instantiate()); + QPluginLoader loader(plugin.fileName()); + m_platform = qobject_cast(loader.instance()); if (m_platform) { m_platform->setParent(this); // check whether it needs libinput @@ -598,6 +599,8 @@ void Application::initPlatform(const KPluginMetaData &plugin) } } Q_EMIT platformCreated(); + } else { + qCWarning(KWIN_CORE) << "Could not create plugin" << plugin.name() << "error:" << loader.errorString(); } }