[frameworks/syntax-highlighting] src/lib: Fix listening for language changes, just react on the app instance event
Friedrich W. H. Kossebau <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 9ba269803e1baa918b8f0487433c91ea6400894f by Friedrich W. H. Kossebau.
Committed on 18/07/2026 at 17:49.
Pushed by cullmann into branch 'master'.
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.
M +1 -1 src/lib/repository.cpp
https://invent.kde.org/frameworks/syntax-highlighting/-/commit/9ba269803e1baa918b8f0487433c91ea6400894f
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();