[pim/kleopatra] src: Silence deprecation warning for KWaylandExtras::exportWindow

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit e50565fa756eb8db56cbbc915bef08be6e4f9e38 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 06/08/2026 at 07:57.
Pushed by kloecker into branch 'master'.

Silence deprecation warning for KWaylandExtras::exportWindow

I tried to use the recommended replacement KWaylandExtras::exportTopLevel
but this makes Kleopatra crash on start.

M  +10   -0    src/kleopatraapplication.cpp

https://invent.kde.org/pim/kleopatra/-/commit/e50565fa756eb8db56cbbc915bef08be6e4f9e38

diff --git a/src/kleopatraapplication.cpp b/src/kleopatraapplication.cpp
index 6f77f0c1d..cf5a99fd8 100644
--- a/src/kleopatraapplication.cpp
+++ b/src/kleopatraapplication.cpp
@@ -319,7 +319,17 @@ public:
     void exportFocusWindow()
     {
 #ifdef HAVE_WAYLAND
+        // #if KWINDOWSYSTEM_VERSION >= QT_VERSION_CHECK(6, 28, 0)
+        //         KWaylandExtras::exportToplevel(QGuiApplication::focusWindow());
+        // #else
+        QT_WARNING_PUSH
+        QT_WARNING_DISABLE_DEPRECATED
+        // silence the deprecation warning for KWaylandExtras::exportWindow;
+        // using the recommended replacement KWaylandExtras::exportTopLevel causes a crash:
+        // https://bugs.kde.org/show_bug.cgi?id=523917
         KWaylandExtras::self()->exportWindow(QGuiApplication::focusWindow());
+        QT_WARNING_POP
+        // #endif
 #endif
     }
 };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.