.TH "KConfigGroupSaver" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KConfigGroupSaver \- Helper class to facilitate working with \fBKConfig\fP / \fBKSimpleConfig\fP groups. Helper class for easier use of KConfig/KSimpleConfig groups.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kconfigbase.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKConfigGroupSaver\fP (\fBKConfigBase\fP *config, \fBQString\fP group)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "\fBKConfigGroupSaver\fP (\fBKConfigBase\fP *config, const  char *group)"
.br
.ti -1c
.RI "\fBKConfigGroupSaver\fP (\fBKConfigBase\fP *config, const  \fBQCString\fP &group)"
.br
.ti -1c
.RI "\fBKConfigBase\fP * \fBconfig\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
Helper class to facilitate working with \fBKConfig\fP / \fBKSimpleConfig\fP groups. Helper class for easier use of KConfig/KSimpleConfig groups. 

Careful programmers always set the group of a \fBKConfig\fP \fBKSimpleConfig\fP object to the group they want to read from and set it back to the old one of afterwards. This is usually written as: 
.PP
.nf

.PP
.PP
.PP
.nf
 \fBQString\fP oldgroup config->group();
 config->setGroup( 'TheGroupThatIWant' );
 ...
 config->writeEntry( 'Blah', 'Blubb' );
.PP
.PP
.PP
.nf
 config->setGroup( oldgroup );
 
.PP
.PP
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.
.PP
\fBAuthor:\fP
.RS 4
Matthias Kalle Dalheimer <kalle@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkconfigbase.h\fP,v 1.83.2.1 2003/06/22 21:39:31 deller Exp 
.RE
.PP
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKConfigBase\fP, \fBKConfig\fP, \fBKSimpleConfig\fP 
.RE
.PP

.PP
Definition at line 1840 of file kconfigbase.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KConfigGroupSaver::KConfigGroupSaver (\fBKConfigBase\fP * config, \fBQString\fP group)\fC [inline]\fP"
.PP
Constructor. You pass a pointer to the KConfigBase-derived object you want to work with and a string indicating the _new_ group. 
.PP
\fBParameters:\fP
.RS 4
\fIconfig\fP The KConfigBase-derived object this KConfigGroupSaver works on. 
.br
\fIgroup\fP The new group that the config object should switch to. 
.RE
.PP
Definition at line 1851 of file kconfigbase.h.
.PP
References KConfigBase::setGroup().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
