kconfigbase.h
/*
This file is part of the KDE libraries
Copyright (c) 1999 Preston Brown <pbrown@kde.org>
Copyright (c) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KCONFIGBASE_H
#define _KCONFIGBASE_H
#include <qobject.h>
#include <qcolor.h>
#include <qfont.h>
#include <qdatetime.h>
#include <qstrlist.h>
#include <qstringlist.h>
#include <qvariant.h>
#include <qmap.h>
#include "kconfigdata.h"
#include "kdelibs_export.h"
class KConfigBackEnd;
class KConfigBasePrivate;
class KConfigGroup;
class KDECORE_EXPORT KConfigBase : public QObject
{
Q_OBJECT
friend class KConfigBackEnd;
friend class KConfigINIBackEnd;
friend class KConfigGroup;
public:
KConfigBase();
virtual ~KConfigBase();
void setGroup( const QString& group );
void setDesktopGroup();
QString group() const;
bool hasGroup(const QString &group) const;
virtual QStringList groupList() const = 0;
QString locale() const;
QString readEntry(const QString& pKey,
const QString& aDefault = QString::null ) const;
QString readEntry(const char *pKey,
const QString& aDefault = QString::null ) const;
QVariant readPropertyEntry( const QString& pKey, QVariant::Type ) const;
QVariant readPropertyEntry( const char *pKey, QVariant::Type ) const;
QVariant readPropertyEntry( const QString& pKey,
const QVariant &aDefault) const;
QVariant readPropertyEntry( const char *pKey,
const QVariant &aDefault) const;
int readListEntry( const QString& pKey, QStrList &list, char sep = ',' ) const;
int readListEntry( const char *pKey, QStrList &list, char sep = ',' ) const;
QStringList readListEntry( const QString& pKey, char sep = ',' ) const;
QStringList readListEntry( const char *pKey, char sep = ',' ) const;
QStringList readListEntry( const char* pKey, const QStringList& aDefault,
char sep = ',' ) const;
QValueList<int> readIntListEntry( const QString& pKey ) const;
QValueList<int> readIntListEntry( const char *pKey ) const;
QString readPathEntry( const QString& pKey, const QString & aDefault = QString::null ) const;
QString readPathEntry( const char *pKey, const QString & aDefault = QString::null ) const;
QStringList readPathListEntry( const QString& pKey, char sep = ',' ) const;
QStringList readPathListEntry( const char *pKey, char sep = ',' ) const;
int readNumEntry( const QString& pKey, int nDefault = 0 ) const;
int readNumEntry( const char *pKey, int nDefault = 0 ) const;
unsigned int readUnsignedNumEntry( const QString& pKey, unsigned int nDefault = 0 ) const;
unsigned int readUnsignedNumEntry( const char *pKey, unsigned int nDefault = 0 ) const;
long readLongNumEntry( const QString& pKey, long nDefault = 0 ) const;
long readLongNumEntry( const char *pKey, long nDefault = 0 ) const;
unsigned long readUnsignedLongNumEntry( const QString& pKey, unsigned long nDefault = 0 ) const;
unsigned long readUnsignedLongNumEntry( const char *pKey, unsigned long nDefault = 0 ) const;
Q_INT64 readNum64Entry( const QString& pKey, Q_INT64 nDefault = 0 ) const;
Q_INT64 readNum64Entry( const char *pKey, Q_INT64 nDefault = 0 ) const;
Q_UINT64 readUnsignedNum64Entry( const QString& pKey, Q_UINT64 nDefault = 0 ) const;
Q_UINT64 readUnsignedNum64Entry( const char *pKey, Q_UINT64 nDefault = 0 ) const;
double readDoubleNumEntry( const QString& pKey, double nDefault = 0.0 ) const;
double readDoubleNumEntry( const char *pKey, double nDefault = 0.0 ) const;
QFont readFontEntry( const QString& pKey, const QFont* pDefault = 0L ) const;
QFont readFontEntry( const char *pKey, const QFont* pDefault = 0L ) const;
bool readBoolEntry( const QString& pKey, bool bDefault = false ) const;
bool readBoolEntry( const char *pKey, bool bDefault = false ) const;
QRect readRectEntry( const QString& pKey, const QRect* pDefault = 0L ) const;
QRect readRectEntry( const char *pKey, const QRect* pDefault = 0L ) const;
QPoint readPointEntry( const QString& pKey, const QPoint* pDefault = 0L ) const;
QPoint readPointEntry( const char *pKey, const QPoint* pDefault = 0L ) const;
QSize readSizeEntry( const QString& pKey, const QSize* pDefault = 0L ) const;
QSize readSizeEntry( const char *pKey, const QSize* pDefault = 0L ) const;
QColor readColorEntry( const QString& pKey, const QColor* pDefault = 0L ) const;
QColor readColorEntry( const char *pKey, const QColor* pDefault = 0L ) const;
QDateTime readDateTimeEntry( const QString& pKey, const QDateTime* pDefault = 0L ) const;
QDateTime readDateTimeEntry( const char *pKey, const QDateTime* pDefault = 0L ) const;
QString readEntryUntranslated( const QString& pKey,
const QString& aDefault = QString::null ) const;
QString readEntryUntranslated( const char *pKey,
const QString& aDefault = QString::null ) const;
void writeEntry( const QString& pKey, const QString& pValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QString& pValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QVariant& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QVariant& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QStrList &rValue,
char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writeEntry( const char *pKey, const QStrList &rValue,
char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writeEntry( const QString& pKey, const QStringList &rValue,
char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writeEntry( const char *pKey, const QStringList &rValue,
char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writeEntry( const QString& pKey, const QValueList<int>& rValue,
bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writeEntry( const char *pKey, const QValueList<int>& rValue,
bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writeEntry( const QString& pKey, const char *pValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false )
{ writeEntry(pKey, QString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
void writeEntry( const char *pKey, const char *pValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false )
{ writeEntry(pKey, QString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
void writeEntry( const QString& pKey, int nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, int nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, unsigned int nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, unsigned int nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, long nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, long nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, unsigned long nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, unsigned long nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, Q_INT64 nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, Q_INT64 nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, Q_UINT64 nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, Q_UINT64 nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, double nValue,
bool bPersistent = true, bool bGlobal = false,
char format = 'g', int precision = 6,
bool bNLS = false );
void writeEntry( const char *pKey, double nValue,
bool bPersistent = true, bool bGlobal = false,
char format = 'g', int precision = 6,
bool bNLS = false );
void writeEntry( const QString& pKey, bool bValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, bool bValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QFont& rFont,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QFont& rFont,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QColor& rColor,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QColor& rColor,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QDateTime& rDateTime,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QDateTime& rDateTime,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QRect& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QRect& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QPoint& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QPoint& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const QString& pKey, const QSize& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writeEntry( const char *pKey, const QSize& rValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writePathEntry( const QString& pKey, const QString & path,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writePathEntry( const char *pKey, const QString & path,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
void writePathEntry( const QString& pKey, const QStringList &rValue,
char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void writePathEntry( const char *pKey, const QStringList &rValue,
char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
void deleteEntry( const QString& pKey,
bool bNLS = false, bool bGlobal = false);
void deleteEntry( const char *pKey,
bool bNLS = false, bool bGlobal = false);
bool deleteGroup( const QString& group, bool bDeep = true, bool bGlobal = false );
void setDollarExpansion( bool _bExpand = true ) { bExpand = _bExpand; }
bool isDollarExpansion() const { return bExpand; }
virtual void rollback( bool bDeep = true );
virtual void sync();
bool isDirty() const { return bDirty; }
virtual void setReadOnly(bool _ro) { bReadOnly = _ro; }
bool isReadOnly() const { return bReadOnly; }
bool hasKey( const QString& key ) const;
virtual QMap<QString, QString> entryMap(const QString &group) const = 0;
virtual void reparseConfiguration() = 0;
bool isImmutable() const;
bool groupIsImmutable(const QString &group) const;
bool entryIsImmutable(const QString &key) const;
enum ConfigState { NoAccess, ReadOnly, ReadWrite };
ConfigState getConfigState() const;
bool checkConfigFilesWritable(bool warnUser);
void setReadDefaults(bool b);
bool readDefaults() const;
void revertToDefault(const QString &key);
bool hasDefault(const QString &key) const;
protected:
void setLocale();
virtual void setDirty(bool _bDirty = true) { bDirty = _bDirty; }
virtual void parseConfigFiles();
virtual KEntryMap internalEntryMap( const QString& pGroup ) const = 0;
virtual KEntryMap internalEntryMap() const = 0;
virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true) = 0;
virtual KEntry lookupData(const KEntryKey &_key) const = 0;
virtual bool internalHasGroup(const QCString &group) const = 0;
KConfigBackEnd *backEnd;
public:
void setGroup( const QCString &pGroup );
void setGroup( const char *pGroup );
bool hasGroup(const QCString &_pGroup) const;
bool hasGroup(const char *_pGroup) const;
bool hasKey( const char *pKey ) const;
protected:
QCString readEntryUtf8( const char *pKey) const;
QCString mGroup;
QCString aLocaleString;
bool bDirty;
bool bLocaleInitialized;
bool bReadOnly; // currently only used by KSimpleConfig
mutable bool bExpand; // whether dollar expansion is used
protected:
virtual void virtual_hook( int id, void* data );
private:
class KConfigBasePrivate;
KConfigBasePrivate *d;
void writeEntry( const char *pKey, const QString &rValue,
bool bPersistent, bool bGlobal, bool bNLS, bool bExpand );
void writeEntry( const char *pKey, const QStringList &rValue,
char sep, bool bPersistent, bool bGlobal, bool bNLS, bool bExpand );
};
class KConfigGroupSaverPrivate;
class KDECORE_EXPORT KConfigGroupSaver // KDE4 remove
{
public:
KConfigGroupSaver( KConfigBase* config, QString group )
/* KDE 4 : make the second parameter const QString & */
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
KConfigGroupSaver( KConfigBase* config, const char *group )
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
KConfigGroupSaver( KConfigBase* config, const QCString &group )
: _config(config), _oldgroup(config->group())
{ _config->setGroup( group ); }
~KConfigGroupSaver() { _config->setGroup( _oldgroup ); }
KConfigBase* config() { return _config; };
private:
KConfigBase* _config;
QString _oldgroup;
KConfigGroupSaver(const KConfigGroupSaver&);
KConfigGroupSaver& operator=(const KConfigGroupSaver&);
KConfigGroupSaverPrivate *d;
};
class KConfigGroupPrivate;
class KDECORE_EXPORT KConfigGroup: public KConfigBase
{
public:
KConfigGroup(KConfigBase *master, const QCString &group);
KConfigGroup(KConfigBase *master, const QString &group);
KConfigGroup(KConfigBase *master, const char * group);
void deleteGroup(bool bGlobal = false);
bool groupIsImmutable() const;
// The following functions are reimplemented:
virtual void setDirty(bool _bDirty);
virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true);
virtual KEntry lookupData(const KEntryKey &_key) const;
virtual void sync();
private:
// Hide the following members:
void setGroup() { }
void setDesktopGroup() { }
void group() { }
void hasGroup() { }
void setReadOnly(bool) { }
void isDirty() { }
// The following members are not used.
virtual QStringList groupList() const { return QStringList(); }
virtual void rollback(bool) { }
virtual void reparseConfiguration() { }
virtual QMap<QString, QString> entryMap(const QString &) const
{ return QMap<QString,QString>(); }
virtual KEntryMap internalEntryMap( const QString&) const
{ return KEntryMap(); }
virtual KEntryMap internalEntryMap() const
{ return KEntryMap(); }
virtual bool internalHasGroup(const QCString &) const
{ return false; }
void getConfigState() { }
KConfigBase *mMaster;
protected:
virtual void virtual_hook( int id, void* data );
private:
KConfigGroupPrivate* d;
};
#endif
KConfigBase::putData
virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true)=0
Inserts a (key/value) pair into the internal storage mechanism of the configuration object...
KConfigBase::readSizeEntry
QSize readSizeEntry(const QString &pKey, const QSize *pDefault=0L) const
Reads a QSize entry.
Definition: kconfigbase.cpp:889
KConfigBase::readRectEntry
QRect readRectEntry(const QString &pKey, const QRect *pDefault=0L) const
Reads a QRect entry.
Definition: kconfigbase.cpp:840
KConfigBase::readListEntry
int readListEntry(const QString &pKey, QStrList &list, char sep= ',') const
Reads a list of strings.
Definition: kconfigbase.cpp:435
KConfigBase::readPointEntry
QPoint readPointEntry(const QString &pKey, const QPoint *pDefault=0L) const
Reads a QPoint entry.
Definition: kconfigbase.cpp:864
KConfigBase::checkConfigFilesWritable
bool checkConfigFilesWritable(bool warnUser)
Check whether the config files are writable.
Definition: kconfigbase.cpp:1861
KConfigBase::readDefaults
bool readDefaults() const
Definition: kconfigbase.cpp:1729
KConfigBase::readDateTimeEntry
QDateTime readDateTimeEntry(const QString &pKey, const QDateTime *pDefault=0L) const
Reads a QDateTime entry.
Definition: kconfigbase.cpp:980
KConfigBase::ConfigState
ConfigState
Possible return values for getConfigState().
Definition: kconfigbase.h:1804
KConfigBase::internalEntryMap
virtual KEntryMap internalEntryMap() const =0
Returns a map (tree) of the entries in the tree.
KEntry
map/dict/list config node entry.
Definition: kconfigdata.h:32
KConfigBase::groupIsImmutable
bool groupIsImmutable(const QString &group) const
Checks whether it is possible to change the given group.
Definition: kconfigbase.cpp:154
KConfigBase::isReadOnly
bool isReadOnly() const
Returns the read-only status of the config object.
Definition: kconfigbase.h:1738
KConfigBase::hasKey
bool hasKey(const QString &key) const
Checks whether the key has an entry in the currently active group.
Definition: kconfigbase.cpp:109
KConfigBase::hasDefault
bool hasDefault(const QString &key) const
Returns whether a default is specified for an entry in either the system wide configuration file or t...
Definition: kconfigbase.cpp:1761
KConfigBase::readFontEntry
QFont readFontEntry(const QString &pKey, const QFont *pDefault=0L) const
Reads a QFont value.
Definition: kconfigbase.cpp:743
KConfigBase::hasGroup
bool hasGroup(const QString &group) const
Returns true if the specified group is known about.
Definition: kconfigbase.cpp:134
KConfigBase::readIntListEntry
QValueList< int > readIntListEntry(const QString &pKey) const
Reads a list of Integers.
Definition: kconfigbase.cpp:535
KConfigBase::readPropertyEntry
QVariant readPropertyEntry(const QString &pKey, QVariant::Type) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:335
KConfigGroup::lookupData
virtual KEntry lookupData(const KEntryKey &_key) const
Looks up an entry in the config object's internal structure.
Definition: kconfigbase.cpp:1845
KConfigBase::sync
virtual void sync()
Flushes all changes that currently reside only in memory back to disk / permanent storage...
Definition: kconfigbase.cpp:1695
KConfigBase::readNum64Entry
Q_INT64 readNum64Entry(const QString &pKey, Q_INT64 nDefault=0) const
Reads a 64-bit numerical value.
Definition: kconfigbase.cpp:658
KConfigBase::readPathEntry
QString readPathEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads a path.
Definition: kconfigbase.cpp:553
KConfigBase::~KConfigBase
virtual ~KConfigBase()
Destructs the KConfigBase object.
Definition: kconfigbase.cpp:57
KConfigBase::mGroup
QCString mGroup
The currently selected group.
Definition: kconfigbase.h:1991
KConfigBase::reparseConfiguration
virtual void reparseConfiguration()=0
Reparses all configuration files.
KConfigGroup::putData
virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true)
Inserts a (key/value) pair into the internal storage mechanism of the configuration object...
Definition: kconfigbase.cpp:1840
KConfigGroup::groupIsImmutable
bool groupIsImmutable() const
Checks whether it is possible to change this group.
Definition: kconfigbase.cpp:1830
KConfigBase::setDirty
virtual void setDirty(bool _bDirty=true)
Sets the global dirty flag of the config object.
Definition: kconfigbase.h:1898
KConfigBase::readLongNumEntry
long readLongNumEntry(const QString &pKey, long nDefault=0) const
Reads a numerical value.
Definition: kconfigbase.cpp:621
KConfigBase::aLocaleString
QCString aLocaleString
The locale to retrieve keys under if possible, i.e en_US or fr.
Definition: kconfigbase.h:1995
KConfigBase::isDirty
bool isDirty() const
Checks whether the config file has any dirty (modified) entries.
Definition: kconfigbase.h:1722
KEntryKey
key structure holding both the actual key and the the group to which it belongs.
Definition: kconfigdata.h:69
KConfigBase::setReadDefaults
void setReadDefaults(bool b)
When set, all readEntry and readXXXEntry calls return the system wide (default) values instead of the...
Definition: kconfigbase.cpp:1718
KConfigGroup::deleteGroup
void deleteGroup(bool bGlobal=false)
Delete all entries in the entire group.
Definition: kconfigbase.cpp:1825
KConfigGroupSaver::KConfigGroupSaver
KConfigGroupSaver(KConfigBase *config, QString group)
Constructor.
Definition: kconfigbase.h:2069
KConfigBase::readDoubleNumEntry
double readDoubleNumEntry(const QString &pKey, double nDefault=0.0) const
Reads a floating point value.
Definition: kconfigbase.cpp:697
KConfigBase::writeEntry
void writeEntry(const QString &pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Write a (key/value) pair.
Definition: kconfigbase.h:978
KConfigBase::setDollarExpansion
void setDollarExpansion(bool _bExpand=true)
Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries...
Definition: kconfigbase.h:1678
KConfigBase::parseConfigFiles
virtual void parseConfigFiles()
Parses all configuration files for a configuration object.
Definition: kconfigbase.cpp:1683
KConfigBase::readUnsignedLongNumEntry
unsigned long readUnsignedLongNumEntry(const QString &pKey, unsigned long nDefault=0) const
Read an unsigned numerical value.
Definition: kconfigbase.cpp:640
KConfigBase::lookupData
virtual KEntry lookupData(const KEntryKey &_key) const =0
Looks up an entry in the config object's internal structure.
KConfigGroupSaver
Helper class to facilitate working with KConfig / KSimpleConfig groups.
Definition: kconfigbase.h:2057
KConfigBase::isDollarExpansion
bool isDollarExpansion() const
Returns whether dollar expansion is on or off.
Definition: kconfigbase.h:1685
KConfigBase::backEnd
KConfigBackEnd * backEnd
A back end for loading/saving to disk in a particular format.
Definition: kconfigbase.h:1975
KConfigINIBackEnd
Class for KDE INI-style configuration file loading/saving.
Definition: kconfigbackend.h:190
KConfigBase::setDesktopGroup
void setDesktopGroup()
Sets the group to the "Desktop Entry" group used for desktop configuration files for applications...
Definition: kconfigbase.cpp:104
KConfigBase::readColorEntry
QColor readColorEntry(const QString &pKey, const QColor *pDefault=0L) const
Reads a QColor entry.
Definition: kconfigbase.cpp:915
KConfigBase
KDE Configuration Management abstract base class.
Definition: kconfigbase.h:70
KConfigBase::setLocale
void setLocale()
Reads the locale and put in the configuration data struct.
Definition: kconfigbase.cpp:62
KConfigBase::writePathEntry
void writePathEntry(const QString &pKey, const QString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Writes a file path.
Definition: kconfigbase.cpp:1061
KConfigBase::deleteEntry
void deleteEntry(const QString &pKey, bool bNLS=false, bool bGlobal=false)
Deletes the entry specified by pKey in the current group.
Definition: kconfigbase.cpp:1163
KConfigBase::entryMap
virtual QMap< QString, QString > entryMap(const QString &group) const =0
Returns a map (tree) of entries for all entries in a particular group.
KConfigGroup
A KConfigBase derived class for one specific group in a KConfig object.
Definition: kconfigbase.h:2101
KConfigBase::revertToDefault
void revertToDefault(const QString &key)
Reverts the entry with key key in the current group in the application specific config file to either...
Definition: kconfigbase.cpp:1734
KConfigBase::readPathListEntry
QStringList readPathListEntry(const QString &pKey, char sep= ',') const
Reads a list of string paths.
Definition: kconfigbase.cpp:567
KConfigBackEnd
Abstract base class for KDE configuration file loading/saving.
Definition: kconfigbackend.h:47
KConfigBase::readEntry
QString readEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:203
KConfigBase::locale
QString locale() const
Returns a the current locale.
Definition: kconfigbase.cpp:74
KConfigBase::deleteGroup
bool deleteGroup(const QString &group, bool bDeep=true, bool bGlobal=false)
Deletes a configuration entry group.
Definition: kconfigbase.cpp:1196
KConfigBase::readUnsignedNum64Entry
Q_UINT64 readUnsignedNum64Entry(const QString &pKey, Q_UINT64 nDefault=0) const
Read an 64-bit unsigned numerical value.
Definition: kconfigbase.cpp:678
KConfigBase::readBoolEntry
bool readBoolEntry(const QString &pKey, bool bDefault=false) const
Reads a boolean entry.
Definition: kconfigbase.cpp:716
KConfigBase::setReadOnly
virtual void setReadOnly(bool _ro)
Sets the config object's read-only status.
Definition: kconfigbase.h:1731
KConfigBase::writeEntry
void writeEntry(const char *pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Write a (key/value) pair.
Definition: kconfigbase.h:999
KConfigBase::getConfigState
ConfigState getConfigState() const
Returns the state of the app-config object.
Definition: kconfigbase.cpp:1706
KConfigBase::rollback
virtual void rollback(bool bDeep=true)
Mark the config object as "clean," i.e.
Definition: kconfigbase.cpp:1712
KConfigGroup::sync
virtual void sync()
Flushes all changes that currently reside only in memory back to disk / permanent storage...
Definition: kconfigbase.cpp:1850
KConfigBase::readUnsignedNumEntry
unsigned int readUnsignedNumEntry(const QString &pKey, unsigned int nDefault=0) const
Reads an unsigned numerical value.
Definition: kconfigbase.cpp:602
KConfigBase::entryIsImmutable
bool entryIsImmutable(const QString &key) const
Checks whether it is possible to change the given entry.
Definition: kconfigbase.cpp:164
KConfigBase::bDirty
bool bDirty
Indicates whether there are any dirty entries in the config object that need to be written back to di...
Definition: kconfigbase.h:2000
KConfigBase::setGroup
void setGroup(const QString &group)
Specifies the group in which keys will be read and written.
Definition: kconfigbase.cpp:79
KConfigBase::writeEntry
void writeEntry(const QString &pKey, const QString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Writes a key/value pair.
Definition: kconfigbase.cpp:1012
KConfigBase::readEntryUntranslated
QString readEntryUntranslated(const QString &pKey, const QString &aDefault=QString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:186
KConfigBase::groupList
virtual QStringList groupList() const =0
Returns a list of groups that are known about.
KConfigBase::isImmutable
bool isImmutable() const
Checks whether this configuration file can be modified.
Definition: kconfigbase.cpp:149
KConfigBase::readNumEntry
int readNumEntry(const QString &pKey, int nDefault=0) const
Reads a numerical value.
Definition: kconfigbase.cpp:581
KConfigBase::group
QString group() const
Returns the name of the group in which we are searching for keys and from which we are retrieving ent...
Definition: kconfigbase.cpp:100
KConfigBase::KConfigBase
KConfigBase()
Construct a KConfigBase object.
Definition: kconfigbase.cpp:50

KDE Home | KDE Accessibility Home | Description of Access Keys