<HTML> <HEAD> <TITLE>class KConfigGroupSaver</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>class KConfigGroupSaver</h1> </TD> <TD valign="top" align="right" colspan="1">Helper class for easier use of KConfig/KSimpleConfig groups. <small><A HREF="#longdesc">More...</A></small></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> <TR><TH>Definition</TH><TD><code>#include <<A HREF="kconfigbase_h.html">kconfigbase.h</A>></code></TD></TR> <TR><TH><A HREF="full-list-KConfigGroupSaver.html">List of all Methods</A></TH></TR> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <h4>Public Methods</h4><ul><LI> <b><A HREF="#ref1">KConfigGroupSaver</A></b> ( <A HREF="KConfigBase.html">KConfigBase</A>* config, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> group ) </LI> <LI> <b><A HREF="#ref2">KConfigGroupSaver</A></b> ( <A HREF="KConfigBase.html">KConfigBase</A>* config, const char *group ) </LI> <LI> <b><A HREF="#ref3">KConfigGroupSaver</A></b> ( <A HREF="KConfigBase.html">KConfigBase</A>* config, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A> &group ) </LI> <LI> <b><A HREF="#ref4">~KConfigGroupSaver</A></b> () </LI> <LI><A HREF="KConfigBase.html">KConfigBase</A>* <b><A HREF="#ref5">config</A></b> () </LI> </ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p> Helper class to facilitate working with <A HREF="KConfig.html">KConfig</A> / <A HREF="KSimpleConfig.html">KSimpleConfig</A> groups. </p> <p> Careful programmers always set the group of a <A HREF="KConfig.html">KConfig</A> <A HREF="KSimpleConfig.html">KSimpleConfig</A> object to the group they want to read from and set it back to the old one of afterwards. This is usually written as: </p><table border="0" width="100%"> <tr> <td bgcolor="#BEEAE0"> <pre> <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> oldgroup <A HREF="KConfigGroupSaver.html#config">config</A>->group(); <A HREF="KConfigGroupSaver.html#config">config</A>->setGroup( "TheGroupThatIWant" ); ... <A HREF="KConfigGroupSaver.html#config">config</A>->writeEntry( "Blah", "Blubb" ); <A HREF="KConfigGroupSaver.html#config">config</A>->setGroup( oldgroup ); </pre> </td></tr> </table> <p> </p> <p> 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. </p> <p></p> <p><b>See also</b>: <i><A HREF="KConfigBase.html">KConfigBase</A></i>, <A HREF="KConfig.html">KConfig</A>, <A HREF="KSimpleConfig.html">KSimpleConfig</A></p> <A NAME="KConfigGroupSaver"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>KConfigGroupSaver</strong> ( <A HREF="KConfigBase.html">KConfigBase</A>* config, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> group ) <br></td><td align="right"><h3><strong>KConfigGroupSaver</strong></h3></td></tr></table><p></p><p> Constructor. You pass a pointer to the KConfigBase-derived object you want to work with and a string indicating the _new_ group. </p> <p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5"> <TR><TD align="left" valign="top"><i>config</i></TD><TD align="left" valign="top">The KConfigBase-derived object this KConfigGroupSaver works on. </TD></TR> <TR><TD align="left" valign="top"><i>group</i></TD><TD align="left" valign="top">The new group that the config object should switch to. </TD></TR> </TABLE></P> <A NAME="KConfigGroupSaver"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>KConfigGroupSaver</strong> ( <A HREF="KConfigBase.html">KConfigBase</A>* config, const char *group ) <br></td><td align="right"><h3><strong>KConfigGroupSaver</strong></h3></td></tr></table><p></p><A NAME="KConfigGroupSaver"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>KConfigGroupSaver</strong> ( <A HREF="KConfigBase.html">KConfigBase</A>* config, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A> &group ) <br></td><td align="right"><h3><strong>KConfigGroupSaver</strong></h3></td></tr></table><p></p><A NAME="~KConfigGroupSaver"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~KConfigGroupSaver</strong> () <br></td><td align="right"><h3><strong>~KConfigGroupSaver</strong></h3></td></tr></table><p></p><A NAME="config"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="KConfigBase.html">KConfigBase</A>* <strong>config</strong> () <br></td><td align="right"><h3><strong>config</strong></h3></td></tr></table><p></p><HR><UL><LI><i>Version</i>: $Id: kconfigbase.h,v 1.52 2001/07/26 16:15:25 porten Exp $ </LI><LI><i>Author</i>: Matthias Kalle Dalheimer <kalle@kde.org> </LI><LI><i>Generated</i>: qateam on updates.mandrakesoft.com on Mon Dec 30 16:08:56 2002, using kdoc 2.0a53.</LI></UL></BODY></HTML>