KSettings::Dispatcher

KSettings::Dispatcher Namespace Reference

Functions

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");
Author
Matthias Kretz kretz[email protected]@kde[email protected].org

Function Documentation

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

Definition at line 38 of file dispatcher.cpp.

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.

Parameters
componentNameThe name of the component
recvThe object that should receive the signal
slotThe slot to be called: "slotName"
Deprecated:
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.

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.

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

Definition at line 50 of file dispatcher.cpp.

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.

Deprecated:
Since 5.85, manually sync the config instead

Definition at line 67 of file dispatcher.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Nov 28 2021 22:39:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.