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

KDECore

KConfigGroupSaver Class Reference

Helper class to facilitate working with KConfig / KSimpleConfig groups. More...

#include <kconfigbase.h>

List of all members.


Public Member Functions

KConfigBase * config ()
 KConfigGroupSaver (KConfigBase *config, const QCString &group)
 KConfigGroupSaver (KConfigBase *config, const char *group)
 KConfigGroupSaver (KConfigBase *config, QString group)
 ~KConfigGroupSaver ()

Detailed Description

Helper class to facilitate working with KConfig / KSimpleConfig groups.

Careful programmers always set the group of a KConfig KSimpleConfig object to the group they want to read from and set it back to the old one of afterwards. This is usually written as:

 QString oldgroup config->group();
 config->setGroup( "TheGroupThatIWant" );
 ...
 config->writeEntry( "Blah", "Blubb" );

 config->setGroup( oldgroup );

In order to facilitate this task, you can use KConfigGroupSaver. Simply construct such an object ON THE STACK when you want to switch to a new group. Then, when the object goes out of scope, the group will automatically be restored. If you want to use several different groups within a function or method, you can still use KConfigGroupSaver: Simply enclose all work with one group (including the creation of the KConfigGroupSaver object) in one block.

Deprecated:
This class is deprecated and will be removed in KDE 4. KConfigGroup provides similar functionality in a more object oriented way.
Author:
Matthias Kalle Dalheimer <kalle@kde.org>
See also:
KConfigBase, KConfig, KSimpleConfig, KConfigGroup Helper class for easier use of KConfig/KSimpleConfig groups

Definition at line 2057 of file kconfigbase.h.


Constructor & Destructor Documentation

KConfigGroupSaver::KConfigGroupSaver ( KConfigBase *  config,
QString  group 
) [inline]

Constructor.

You pass a pointer to the KConfigBase-derived object you want to work with and a string indicating the _new_ group.

Parameters:
config The KConfigBase-derived object this KConfigGroupSaver works on.
group The new group that the config object should switch to.

Definition at line 2069 of file kconfigbase.h.

KConfigGroupSaver::KConfigGroupSaver ( KConfigBase *  config,
const char *  group 
) [inline]

Definition at line 2074 of file kconfigbase.h.

KConfigGroupSaver::KConfigGroupSaver ( KConfigBase *  config,
const QCString &  group 
) [inline]

Definition at line 2078 of file kconfigbase.h.

KConfigGroupSaver::~KConfigGroupSaver (  )  [inline]

Definition at line 2082 of file kconfigbase.h.


Member Function Documentation

KConfigBase* KConfigGroupSaver::config (  )  [inline]

Definition at line 2084 of file kconfigbase.h.


The documentation for this class was generated from the following file:
  • kconfigbase.h

KDECore

Skip menu "KDECore"
  • 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