KSettings::Dispatcher Namespace Reference


QList< QStringcomponentNames ()
KSharedConfig::Ptr configForComponentName (const QString &componentName)
void registerComponent (const QString &componentName, QObject *recv, const char *slot)
void reparseConfiguration (const QString &componentName)
void syncConfiguration ()

Detailed Description

Dispatch change notifications from the KCMs to the program.

Since your program does not have direct control over the KCMs that get loaded into KSettings::Dialog you need a way to get notified. This is what you do:

Dispatcher::registerComponent(componentData(), this, "loadSettings");
Matthias Kretz kretz[email protected]@kde[email protected].org

Function Documentation

◆ componentNames()

QList<QString> KSettings::Dispatcher::componentNames ( )
the KConfig object that belongs to the componentName
Since 5.85, use KSharedConfig::openConfig(componentName + QStringLiteral("rc")) instaed
a list of all the componentData names that are currently registered
Since 5.85, this method is obsolete, see registerComponent API docs.

Definition at line 38 of file dispatcher.cpp.

◆ registerComponent()

KCMUTILS_EXPORT void KSettings::Dispatcher::registerComponent ( const QString componentName,
QObject recv,
const char *  slot 

Register a slot to be called when the configuration for the componentData has changed.

componentName is the string that is passed to KPluginFactory (if it is used). You can query it with MyPluginFactory::componentName(), or from a KAboutData. componentName is also the same name that is put into the .desktop file of the KCMs for the X-KDE-ParentComponents.

componentNameThe name of the component
recvThe object that should receive the signal
slotThe slot to be called: "slotName"
Since 5.85, connect to the KCMultiDialog::configCommitted() signal of the dialog instead and check the componentName

Definition at line 21 of file dispatcher.cpp.

◆ reparseConfiguration()

KCMUTILS_EXPORT void KSettings::Dispatcher::reparseConfiguration ( const QString componentName)

Call this function when the configuration belonging to the associated componentData name has changed.

The registered slot will be called.

componentNameThe value of X-KDE-ParentComponents.
Since 5.85, manually reparse the config instead

Definition at line 50 of file dispatcher.cpp.

◆ syncConfiguration()

KCMUTILS_EXPORT void KSettings::Dispatcher::syncConfiguration ( )

When this function is called the KConfig objects of all the registered instances are sync()ed.

This is useful when some other KConfig objects will read/write from/to the same config file, so that you can first write out the current state of the KConfig objects.

Since 5.85, manually sync the config instead

Definition at line 67 of file dispatcher.cpp.

void registerComponent(const QString &componentName, QObject *recv, const char *slot)
Register a slot to be called when the configuration for the componentData has changed.
Definition: dispatcher.cpp:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:12:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.