summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore/kconfigbase.h
Side-by-side diff
Diffstat (limited to 'microkde/kdecore/kconfigbase.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/kconfigbase.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/microkde/kdecore/kconfigbase.h b/microkde/kdecore/kconfigbase.h
index 7e56d11..1ef6a04 100644
--- a/microkde/kdecore/kconfigbase.h
+++ b/microkde/kdecore/kconfigbase.h
@@ -5,48 +5,50 @@
Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
// $Id$
#ifndef _KCONFIGBASE_H
#define _KCONFIGBASE_H
#include "kconfig.h"
+//Added by qt3to4:
+#include <Q3CString>
/**
* Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig
* groups.
*
* Careful programmers always set the group of a
* @ref KConfig @ref 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:
* <pre>
*
* QString oldgroup config->group();
* config->setGroup( "TheGroupThatIWant" );
* ...
* config->writeEntry( "Blah", "Blubb" );
*
* config->setGroup( oldgroup );
* </pre>
*
* 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,
@@ -61,42 +63,42 @@
*/
//US I converted the class in a way that it can be used with KConfig objects of microkde
class KConfigGroupSaver
{
public:
/**
* Constructor. You pass a pointer to the KConfigBase-derived
* object you want to work with and a string indicating the _new_
* group.
*
* @param config The KConfigBase-derived object this
* KConfigGroupSaver works on.
* @param group The new group that the config object should switch to.
*/
KConfigGroupSaver( KConfig* config, QString group )
/* KDE 4 : make the second parameter const QString & */
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
KConfigGroupSaver( KConfig* config, const char *group )
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
- KConfigGroupSaver( KConfig* config, const QCString &group )
+ KConfigGroupSaver( KConfig* config, const Q3CString &group )
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
~KConfigGroupSaver() { _config->setGroup( _oldgroup ); }
KConfig* config() { return _config; };
private:
KConfig* _config;
QString _oldgroup;
KConfigGroupSaver(const KConfigGroupSaver&);
KConfigGroupSaver& operator=(const KConfigGroupSaver&);
};
#endif