• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

Public Member Functions | List of all members
KConfigGroupSaver Class Reference

#include <kconfigbase.h>

Public Member Functions

 KConfigGroupSaver (KConfigBase *config, TQString group)
 
 KConfigGroupSaver (KConfigBase *config, const char *group)
 
 KConfigGroupSaver (KConfigBase *config, const TQCString &group)
 
KConfigBase * config ()
 

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:

TQString 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.nosp@m.@kde.nosp@m..org
See also
KConfigBase, KConfig, KSimpleConfig, KConfigGroup Helper class for easier use of KConfig/KSimpleConfig groups

Definition at line 2059 of file kconfigbase.h.

Constructor & Destructor Documentation

◆ KConfigGroupSaver()

KConfigGroupSaver::KConfigGroupSaver ( KConfigBase *  config,
TQString  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
configThe KConfigBase-derived object this KConfigGroupSaver works on.
groupThe new group that the config object should switch to.

Definition at line 2071 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

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |