[frameworks/extra-cmake-modules] modules: ecm_create_qm_loader: fix to listen just to language change of app instance
Friedrich W. H. Kossebau <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 2ffc99da94dfb53fa1b9d6541e1368ddf445cb5e by Friedrich W. H. Kossebau.
Committed on 18/07/2026 at 18:29.
Pushed by kossebau into branch 'master'.
ecm_create_qm_loader: fix to listen just to language change of app instance
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 modules/ECMQmLoader.cpp.in
https://invent.kde.org/frameworks/extra-cmake-modules/-/commit/2ffc99da94dfb53fa1b9d6541e1368ddf445cb5e
diff --git a/modules/ECMQmLoader.cpp.in b/modules/ECMQmLoader.cpp.in
index 87e8009f..72718366 100644
--- a/modules/ECMQmLoader.cpp.in
+++ b/modules/ECMQmLoader.cpp.in
@@ -53,7 +53,7 @@ namespace {
private:
bool eventFilter(QObject *obj, QEvent *event) override
{
- if (event->type() == QEvent::LanguageChange) {
+ if ((event->type() == QEvent::LanguageChange) && (obj == QCoreApplication::instance())) {
const auto systemLocaleName = getSystemLocale().name();
if (m_loadedLocale != systemLocaleName) {
m_loadedLocale = systemLocaleName;