kdeui: new KGlobalSettings signal and enum for global config change

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-22 04:28:15 +03:00
parent d281fc7b64
commit b4657deb95
2 changed files with 12 additions and 2 deletions

View file

@ -422,6 +422,11 @@ void KGlobalSettings::emitChange(ChangeType changeType, int arg)
void KGlobalSettings::Private::_k_slotNotifyChange(int changeType, int arg)
{
switch(changeType) {
case SettingsChanged: {
KGlobal::config()->reparseConfiguration();
emit q->settingsChanged();
break;
}
case StyleChanged: {
if (activated) {
KGlobal::config()->reparseConfiguration();

View file

@ -446,8 +446,8 @@ public:
* \see emitChange
*/
enum ChangeType {
PaletteChanged = 0, FontChanged, StyleChanged,
IconChanged, MouseChanged, LocaleChanged,
SettingsChanged = 0, PaletteChanged, FontChanged,
StyleChanged, IconChanged, MouseChanged, LocaleChanged,
ToolbarStyleChanged, PathsChanged, NaturalSortingChanged,
ShortcutsChanged, BlockShortcuts
};
@ -488,6 +488,11 @@ public:
void activate(ActivateOptions options);
Q_SIGNALS:
/**
* Emitted when the global settings have been changed.
*/
void settingsChanged();
/**
* Emitted when the application has changed its palette due to a KControl request.
*