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

tdecore

Public Member Functions | List of all members
TDEConfigGroupSaver Class Reference

#include <tdeconfigbase.h>

Public Member Functions

 TDEConfigGroupSaver (TDEConfigBase *config, TQString group)
 
 TDEConfigGroupSaver (TDEConfigBase *config, const char *group)
 
 TDEConfigGroupSaver (TDEConfigBase *config, const TQCString &group)
 
TDEConfigBase * config ()
 

Detailed Description

Helper class to facilitate working with TDEConfig / KSimpleConfig groups.

Careful programmers always set the group of a TDEConfig 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 );
TDEConfigBase::group
TQString group() const
Returns the name of the group in which we are searching for keys and from which we are retrieving ent...
Definition: tdeconfigbase.cpp:100
TDEConfigBase::setGroup
void setGroup(const TQString &group)
Specifies the group in which keys will be read and written.
Definition: tdeconfigbase.cpp:79

In order to facilitate this task, you can use TDEConfigGroupSaver. 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 TDEConfigGroupSaver: Simply enclose all work with one group (including the creation of the TDEConfigGroupSaver object) in one block.

Deprecated:
This class is deprecated and will be removed in KDE 4. TDEConfigGroup provides similar functionality in a more object oriented way.
Author
Matthias Kalle Dalheimer kalle.nosp@m.@kde.nosp@m..org
See also
TDEConfigBase, TDEConfig, KSimpleConfig, TDEConfigGroup

Helper class for easier use of TDEConfig/KSimpleConfig groups

Definition at line 2082 of file tdeconfigbase.h.

Constructor & Destructor Documentation

◆ TDEConfigGroupSaver() [1/3]

TDEConfigGroupSaver::TDEConfigGroupSaver ( TDEConfigBase *  config,
TQString  group 
)
inline

Constructor.

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

Parameters
configThe TDEConfigBase-derived object this TDEConfigGroupSaver works on.
groupThe new group that the config object should switch to.

Definition at line 2094 of file tdeconfigbase.h.

◆ TDEConfigGroupSaver() [2/3]

TDEConfigGroupSaver::TDEConfigGroupSaver ( TDEConfigBase *  config,
const char *  group 
)
inline

Definition at line 2099 of file tdeconfigbase.h.

◆ TDEConfigGroupSaver() [3/3]

TDEConfigGroupSaver::TDEConfigGroupSaver ( TDEConfigBase *  config,
const TQCString &  group 
)
inline

Definition at line 2103 of file tdeconfigbase.h.

◆ ~TDEConfigGroupSaver()

TDEConfigGroupSaver::~TDEConfigGroupSaver ( )
inline

Definition at line 2107 of file tdeconfigbase.h.

Member Function Documentation

◆ config()

TDEConfigBase * TDEConfigGroupSaver::config ( )
inline

Definition at line 2109 of file tdeconfigbase.h.


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

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.