[frameworks/syntax-highlighting/Frameworks/6.28] src/lib: Fix listening for language changes, just react on the app instance event

Nicolas Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 719b8b3732eee909a0fa0a05b5b245141e735873 by Nicolas Fella, on behalf of Friedrich W. H. Kossebau.
Committed on 20/07/2026 at 18:55.
Pushed by nicolasfella into branch 'Frameworks/6.28'.

Fix listening for language changes, just react on the app instance event

QCoreApplication processes also the events for all objects, thus including
widgets. So the event filter would also see all the LanguageChange event
notification for each of the widgets when the event itself is passed from
the toplevel widgets to all the child widgets.

(cherry picked from commit 9ba269803e1baa918b8f0487433c91ea6400894f)

M  +1    -1    src/lib/repository.cpp

https://invent.kde.org/frameworks/syntax-highlighting/-/commit/719b8b3732eee909a0fa0a05b5b245141e735873

diff --git a/src/lib/repository.cpp b/src/lib/repository.cpp
index 4af8c713d..6d2c127c6 100644
--- a/src/lib/repository.cpp
+++ b/src/lib/repository.cpp
@@ -441,7 +441,7 @@ QList<QString> Repository::customSearchPaths() const
 
 bool Repository::eventFilter(QObject *receiver, QEvent *ev)
 {
-    if (ev->type() == QEvent::LanguageChange) {
+    if ((ev->type() == QEvent::LanguageChange) && (receiver == QCoreApplication::instance())) {
         // definition references remain valid, but sort order by translated name will change
         // so better be on the safe side here
         Q_EMIT aboutToReload();
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.