kdeui: send locale and language change events from KGlobalSettings

the signals come from the locale KCM however applications, libraries and
widgets handling of such changes is mixed - some do it on
QEvent::LocaleChange, some on QEvent::LanguageChange, some when the
KGlobalSettings signal is send so sending the events will make sure that
locale changes take effect immediatly (when and wherethe event is watched
for ofcourse, KCalendarWidget does it for one)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-29 07:55:01 +03:00
parent a2e6cb8a18
commit eebedd4c76

View file

@ -546,11 +546,19 @@ void KGlobalSettings::Private::_k_slotNotifyChange(int changeType, int arg)
}
} else {
switch (category) {
case SETTINGS_LOCALE:
case SETTINGS_LOCALE: {
KGlobal::locale()->reparseConfiguration();
// KLocale is reponsible for both so event for locale and language change
// is send
QEvent localeevent(QEvent::LocaleChange);
QApplication::sendEvent(qApp, &localeevent);
QEvent languageevent(QEvent::LanguageChange);
QApplication::sendEvent(qApp, &languageevent);
break;
default:
}
default: {
break;
}
}
emit q->settingsChanged(category);
}