• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KUtils

KSettings::Dispatcher

KSettings::Dispatcher Class Reference
[Settings UI classes]

Dispatch change notifications from the KCMs to the program. More...

#include <dispatcher.h>

Inheritance diagram for KSettings::Dispatcher:

Inheritance graph
[legend]

List of all members.


Public Slots

void reparseConfiguration (const QCString &instanceName)
void syncConfiguration ()

Public Member Functions

KConfig * configForInstanceName (const QCString &instanceName)
QStrList instanceNames () const
void registerInstance (KInstance *instance, QObject *recv, const char *slot)

Static Public Member Functions

static Dispatcher * self ()

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 the KConfigureDialog you need a way to get notified. This is what you do:

 Dispatcher::self()->registerInstance( instance(), this, SLOT( loadSettings() ) );

Author:
Matthias Kretz <kretz@kde.org>
Since:
3.2

Definition at line 51 of file dispatcher.h.


Member Function Documentation

KConfig * KSettings::Dispatcher::configForInstanceName ( const QCString &  instanceName  ) 

Returns:
the KConfig object that belongs to the instanceName

Definition at line 86 of file dispatcher.cpp.

QStrList KSettings::Dispatcher::instanceNames (  )  const

Returns:
a list of all the instance names that are currently registered

Definition at line 100 of file dispatcher.cpp.

void KSettings::Dispatcher::registerInstance ( KInstance *  instance,
QObject *  recv,
const char *  slot 
)

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

instance is the KInstance object that is passed to KGenericFactory (if it is used). You can query it with KGenericFactory<YourClassName>::instance(). instance->instanceName() is also the same name that is put into the .desktop file of the KCMs for the X-KDE-ParentComponents.

Parameters:
instance The KInstance object
recv The object that should receive the signal
slot The slot to be called: SLOT( slotName() )

Definition at line 61 of file dispatcher.cpp.

void KSettings::Dispatcher::reparseConfiguration ( const QCString &  instanceName  )  [slot]

Call this slot when the configuration belonging to the associated instance name has changed.

The registered slot will be called.

Parameters:
instanceName The value of X-KDE-ParentComponents.

Definition at line 110 of file dispatcher.cpp.

Dispatcher * KSettings::Dispatcher::self (  )  [static]

Get a reference the the Dispatcher object.

Definition at line 40 of file dispatcher.cpp.

void KSettings::Dispatcher::syncConfiguration (  )  [slot]

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

This is usefull 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.

Definition at line 127 of file dispatcher.cpp.


The documentation for this class was generated from the following files:
  • dispatcher.h
  • dispatcher.cpp

KUtils

Skip menu "KUtils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal