class KConfigBase

KDE Configuration Management abstract base class. More...

Contains pure virtuals
Definition#include <kconfigbase.h>
InheritsQObject (qt) [public ]
Inherited byKConfig, KConfigGroup, KDesktopFile, KSimpleConfig
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Protected Methods

Protected Members


Detailed Description

Abstract base class for KDE configuration entries.

This class forms the base for all KDE configuration. It is an abstract base class, meaning that you cannot directly instantiate objects of this class. Either use KConfig (for usual KDE configuration) or KSimpleConfig (for special needs as in ksamba), or even KSharedConfig (stores values in shared memory).

All configuration entries are key, value pairs. Each entry also belongs to a specific group of related entries. All configuration entries that do not explicitly specify which group they are in are in a special group called the default group.

If there is a $ character in an entry, KConfigBase tries to expand environment variable and uses its value instead of its name. You can avoid this feature by having two consecutive $ characters in your config file which get expanded to one.

Note: the '=' char is not allowed in keys and the ']' char is not allowed in group name.

See also: KConfig, KSimpleConfig, KSimpleConfig

 KConfigBase ()

KConfigBase

Construct a KConfigBase object.

 ~KConfigBase ()

~KConfigBase

[virtual]

Destructs the KConfigBase object.

void  setGroup ( const QString& group )

setGroup

Specifies the group in which keys will be read and written.

Subsequent calls to readEntry() and writeEntry() will be aplied only in the activated group.

Switch back to the default group by passing a null string.

Parameters:
groupThe name of the new group.

void  setDesktopGroup ()

setDesktopGroup

Sets the group to the "Desktop Entry" group used for desktop configuration files for applications, mime types, etc.

QString  group ()

group

[const]

Returns the name of the group in which we are searching for keys and from which we are retrieving entries.

Returns: The current group.

bool  hasGroup (const QString &group)

hasGroup

[const]

Returns true if the specified group is known about.

Parameters:
groupThe group to search for.

Returns: Whether the group exists.

QStringList  groupList ()

groupList

[const pure virtual]

Returns a list of groups that are known about.

Returns: The list of groups.

QString  locale ()

locale

[const]

Returns a the current locale.

Returns: A string representing the current locale.

QString  readEntry (const QString& pKey, const QString& aDefault = QString::null )

readEntry

[const]

Reads the value of an entry specified by pKey in the current group.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found.

Returns: The value for this key. Can be QString::null if aDefault it null.

QString  readEntry (const char *pKey, const QString& aDefault = QString::null )

readEntry

[const]

Reads the value of an entry specified by pKey in the current group.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found.

Returns: The value for this key. Can be QString::null if aDefault it null.

QVariant  readPropertyEntry ( const QString& pKey, QVariant::Type )

readPropertyEntry

[const]

Reads the value of an entry specified by pKey in the current group. The value is treated as if it is of the given type.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

Parameters:
pKeyThe key to search for.

Returns: An invalid QVariant if the key was not found or if the read value cannot be converted to the given QVariant::Type.

QVariant  readPropertyEntry ( const char *pKey, QVariant::Type )

readPropertyEntry

[const]

Reads the value of an entry specified by pKey in the current group. The value is treated as if it is of the given type.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

Parameters:
pKeyThe key to search for.

Returns: An invalid QVariant if the key was not found or if the read value cannot be converted to the given QVariant::Type.

QVariant  readPropertyEntry ( const QString& pKey, const QVariant &adefault)

readPropertyEntry

[const]

Reads the value of an entry specified by pKey in the current group. The value is treated as if it is of the type of the given default value.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found or if the read value cannot be converted to the QVariant::Type.

Returns: The value for the key or the default value if the key was not found.

QVariant  readPropertyEntry ( const char *pKey, const QVariant &aDefault)

readPropertyEntry

[const]

Reads the value of an entry specified by pKey in the current group. The value is treated as if it is of the type of the given default value.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found or if the read value cannot be converted to the QVariant::Type.

Returns: The value for the key or the default value if the key was not found.

int  readListEntry ( const QString& pKey, QStrList &list, char sep = ',' )

readListEntry

[const]

Reads a list of strings.

Parameters:
pKeyThe key to search for
listIn this object, the read list will be returned.
sepThe list separator (default ",")

Returns: The number of entries in the list.

int  readListEntry ( const char *pKey, QStrList &list, char sep = ',' )

readListEntry

[const]

Reads a list of strings.

Parameters:
pKeyThe key to search for
listIn this object, the read list will be returned.
sepThe list separator (default ",")

Returns: The number of entries in the list.

QStringList  readListEntry ( const QString& pKey, char sep = ',' )

readListEntry

[const]

Reads a list of strings.

Parameters:
pKeyThe key to search for.
sepThe list separator (default is ",").

Returns: The list. Empty if the entry does not exist.

QStringList  readListEntry ( const char *pKey, char sep = ',' )

readListEntry

[const]

Reads a list of strings.

Parameters:
pKeyThe key to search for.
sepThe list separator (default is ",").

Returns: The list. Empty if the entry does not exist.

QValueList  readIntListEntry ( const QString& pKey )

readIntListEntry

[const]

Reads a list of Integers.

Parameters:
pKeyThe key to search for.

Returns: The list. Empty if the entry does not exist.

QValueList  readIntListEntry ( const char *pKey )

readIntListEntry

[const]

Reads a list of Integers.

Parameters:
pKeyThe key to search for.

Returns: The list. Empty if the entry does not exist.

QString  readPathEntry ( const QString& pKey, const QString & aDefault = QString::null )

readPathEntry

[const]

Reads a path.

Read the value of an entry specified by pKey in the current group and interpret it as a path. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found.

Returns: The value for this key. Can be QString::null if aDefault is null.

QString  readPathEntry ( const char *pKey, const QString & aDefault = QString::null )

readPathEntry

[const]

Reads a path.

Read the value of an entry specified by pKey in the current group and interpret it as a path. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found.

Returns: The value for this key. Can be QString::null if aDefault is null.

int  readNumEntry ( const QString& pKey, int nDefault = 0 )

readNumEntry

[const]

Reads a numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

int  readNumEntry ( const char *pKey, int nDefault = 0 )

readNumEntry

[const]

Reads a numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

unsigned int  readUnsignedNumEntry ( const QString& pKey, unsigned int nDefault = 0 )

readUnsignedNumEntry

[const]

Reads an unsigned numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

unsigned int  readUnsignedNumEntry ( const char *pKey, unsigned int nDefault = 0 )

readUnsignedNumEntry

[const]

Reads an unsigned numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

long  readLongNumEntry ( const QString& pKey, long nDefault = 0 )

readLongNumEntry

[const]

Reads a numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

long  readLongNumEntry ( const char *pKey, long nDefault = 0 )

readLongNumEntry

[const]

Reads a numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

unsigned long  readUnsignedLongNumEntry ( const QString& pKey, unsigned long nDefault = 0 )

readUnsignedLongNumEntry

[const]

Read an unsigned numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

unsigned long  readUnsignedLongNumEntry ( const char *pKey, unsigned long nDefault = 0 )

readUnsignedLongNumEntry

[const]

Read an unsigned numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

double  readDoubleNumEntry ( const QString& pKey, double nDefault = 0.0 )

readDoubleNumEntry

[const]

Reads a floating point value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

double  readDoubleNumEntry ( const char *pKey, double nDefault = 0.0 )

readDoubleNumEntry

[const]

Reads a floating point value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QFont  readFontEntry ( const QString& pKey, const QFont* pDefault = 0L )

readFontEntry

[const]

Reads a QFont value.

Read the value of an entry specified by pKey in the current group and interpret it as a font object.

Parameters:
pKeyThe key to search for.
pDefaultA default value (null QFont by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QFont  readFontEntry ( const char *pKey, const QFont* pDefault = 0L )

readFontEntry

[const]

Reads a QFont value.

Read the value of an entry specified by pKey in the current group and interpret it as a font object.

Parameters:
pKeyThe key to search for.
pDefaultA default value (null QFont by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

bool  readBoolEntry ( const QString& pKey, const bool bDefault = false )

readBoolEntry

[const]

Reads a boolean entry.

Read the value of an entry specified by pKey in the current group and interpret it as a boolean value. Currently "on" and "true" are accepted as true, everything else if false.

Parameters:
pKeyThe key to search for
bDefaultA default value returned if the key was not found.

Returns: The value for this key.

bool  readBoolEntry ( const char *pKey, const bool bDefault = false )

readBoolEntry

[const]

Reads a boolean entry.

Read the value of an entry specified by pKey in the current group and interpret it as a boolean value. Currently "on" and "true" are accepted as true, everything else if false.

Parameters:
pKeyThe key to search for
bDefaultA default value returned if the key was not found.

Returns: The value for this key.

QRect  readRectEntry ( const QString& pKey, const QRect* pDefault = 0L )

readRectEntry

[const]

Reads a QRect entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QRect object.

Parameters:
pKeyThe key to search for
pDefaultA default value (null QRect by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QRect  readRectEntry ( const char *pKey, const QRect* pDefault = 0L )

readRectEntry

[const]

Reads a QRect entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QRect object.

Parameters:
pKeyThe key to search for
pDefaultA default value (null QRect by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QPoint  readPointEntry ( const QString& pKey, const QPoint* pDefault = 0L )

readPointEntry

[const]

Reads a QPoint entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QPoint object.

Parameters:
pKeyThe key to search for
pDefaultA default value (null QPoint by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QPoint  readPointEntry ( const char *pKey, const QPoint* pDefault = 0L )

readPointEntry

[const]

Reads a QPoint entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QPoint object.

Parameters:
pKeyThe key to search for
pDefaultA default value (null QPoint by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QSize  readSizeEntry ( const QString& pKey, const QSize* pDefault = 0L )

readSizeEntry

[const]

Reads a QSize entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QSize object.

Parameters:
pKeyThe key to search for
pDefaultA default value (null QSize by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QSize  readSizeEntry ( const char *pKey, const QSize* pDefault = 0L )

readSizeEntry

[const]

Reads a QSize entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QSize object.

Parameters:
pKeyThe key to search for
pDefaultA default value (null QSize by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QColor  readColorEntry ( const QString& pKey, const QColor* pDefault = 0L )

readColorEntry

[const]

Reads a QColor entry.

Read the value of an entry specified by pKey in the current group and interpret it as a color.

Parameters:
pKeyThe key to search for.
pDefaultA default value (null QColor by default) returned if the key was not found or if the value cannot be interpreted.

Returns: The value for this key.

QColor  readColorEntry ( const char *pKey, const QColor* pDefault = 0L )

readColorEntry

[const]

Reads a QColor entry.

Read the value of an entry specified by pKey in the current group and interpret it as a color.

Parameters:
pKeyThe key to search for.
pDefaultA default value (null QColor by default) returned if the key was not found or if the value cannot be interpreted.

Returns: The value for this key.

QDateTime  readDateTimeEntry ( const QString& pKey, const QDateTime* pDefault = 0L )

readDateTimeEntry

[const]

Reads a QDateTime entry.

Read the value of an entry specified by pKey in the current group and interpret it as a date and time.

Parameters:
pKeyThe key to search for.
pDefaultA default value (currentDateTime() by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QDateTime  readDateTimeEntry ( const char *pKey, const QDateTime* pDefault = 0L )

readDateTimeEntry

[const]

Reads a QDateTime entry.

Read the value of an entry specified by pKey in the current group and interpret it as a date and time.

Parameters:
pKeyThe key to search for.
pDefaultA default value (currentDateTime() by default) returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

QString  readEntryUntranslated ( const QString& pKey, const QString& aDefault = QString::null )

readEntryUntranslated

[const]

Reads the value of an entry specified by pKey in the current group. The untranslated entry is returned, you normally do not need this.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found.

Returns: The value for this key.

QString  readEntryUntranslated ( const char *pKey, const QString& aDefault = QString::null )

readEntryUntranslated

[const]

Reads the value of an entry specified by pKey in the current group. The untranslated entry is returned, you normally do not need this.

Parameters:
pKeyThe key to search for.
aDefaultA default value returned if the key was not found.

Returns: The value for this key.

void  writeEntry ( const QString& pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a key/value pair.

This is stored in the most specific config file when destroying the config object or when calling sync().

Parameters:
pKeyThe key to write.
pValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a key/value pair.

This is stored in the most specific config file when destroying the config object or when calling sync().

Parameters:
pKeyThe key to write.
pValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QVariant& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() Overridden to accept a property.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe property to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const char *pKey, const QVariant& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() Overridden to accept a property.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe property to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const QString& pKey, const QStrList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() overridden to accept a list of strings.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe list to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const char *pKey, const QStrList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() overridden to accept a list of strings.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe list to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const QString& pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() overridden to accept a list of strings.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe list to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const char *pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() overridden to accept a list of strings.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe list to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const QString& pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() overridden to accept a list of Integers.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe list to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const char *pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

writeEntry() overridden to accept a list of Integers.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
rValueThe list to write
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry()

void  writeEntry ( const QString& pKey, const char *pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Write a (key/value) pair.

This is stored to the most specific config file when destroying the config object or when calling sync().

Parameters:
pKeyThe key to write.
pValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const char *pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Write a (key/value) pair.

This is stored to the most specific config file when destroying the config object or when calling sync().

Parameters:
pKeyThe key to write.
pValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Write a (key/value) pair. Same as above, but writes a numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Write a (key/value) pair. Same as above, but writes a numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes an unsigned numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes an unsigned numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but write a long numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but write a long numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes an unsigned long numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes an unsigned long numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a floating-point value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
formatformat determines the format to which the value is converted. Default is 'g'.
precisionprecision sets the precision with which the value is converted. Default is 6 as in QString.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a floating-point value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
formatformat determines the format to which the value is converted. Default is 'g'.
precisionprecision sets the precision with which the value is converted. Default is 6 as in QString.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a boolean value.

Parameters:
pKeyThe key to write.
bValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a boolean value.

Parameters:
pKeyThe key to write.
bValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a font value.

Parameters:
pKeyThe key to write.
rFontThe font value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a font value.

Parameters:
pKeyThe key to write.
rFontThe font value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but write a color entry.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe color value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but write a color entry.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe color value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QDateTime& rDateTime, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a date and time entry.

Note: Unlike the other writeEntry() functions, the old value is not returned here!

Parameters:
pKeyThe key to write.
rValueThe date and time value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QDateTime& rDateTime, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a date and time entry.

Note: Unlike the other writeEntry() functions, the old value is not returned here!

Parameters:
pKeyThe key to write.
rValueThe date and time value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a rectangle.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe rectangle value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a rectangle.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe rectangle value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a point.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe point value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a point.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe point value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const QString& pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a size.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe size value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writeEntry ( const char *pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry

Writes a (key/value) pair. Same as above, but writes a size.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write.
rValueThe size value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writePathEntry ( const QString& pKey, const QString & path, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writePathEntry

Writes a file path.

It is checked whether the path is located under $HOME. If so the path is written out with the user's home-directory replaced with $HOME. The path should be read back with readPathEntry()

Parameters:
pKeyThe key to write.
pathThe path to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  writePathEntry ( const char *pKey, const QString & path, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writePathEntry

Writes a file path.

It is checked whether the path is located under $HOME. If so the path is written out with the user's home-directory replaced with $HOME. The path should be read back with readPathEntry()

Parameters:
pKeyThe key to write.
pathThe path to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

void  deleteEntry ( const QString& pKey, bool bNLS = false, bool bGlobal = false)

deleteEntry

Deletes the entry specified by pKey in the current group.

Parameters:
pKeyThe key to delete.
bGlobalIf bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the key with the locale tag is removed.

void  deleteEntry ( const char *pKey, bool bNLS = false, bool bGlobal = false)

deleteEntry

Deletes the entry specified by pKey in the current group.

Parameters:
pKeyThe key to delete.
bGlobalIf bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
bNLSIf bNLS is true, the key with the locale tag is removed.

bool  deleteGroup ( const QString& group, bool bDeep = true, bool bGlobal = false )

deleteGroup

Deletes a configuration entry group

If the group is not empty and bDeep is false, nothing gets deleted and false is returned. If this group is the current group and it is deleted, the current group is undefined and should be set with setGroup() before the next operation on the configuration object.

Parameters:
groupThe name of the group
bDeepSpecify whether non-empty groups should be completely deleted (including their entries).
bGlobalIf bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.

Returns: If the group is not empty and bDeep is false, deleteGroup returns false.

void  setDollarExpansion ( bool _bExpand = true )

setDollarExpansion

Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries. Dollar sign expansion is initially OFF.

Parameters:
_bExpandTf true, dollar expansion is turned on.

bool  isDollarExpansion ()

isDollarExpansion

[const]

Returns whether dollar expansion is on or off. It is initially OFF.

Returns: true if dollar expansion is on.

void  rollback ( bool bDeep = true )

rollback

[virtual]

Mark the config object as "clean," i.e. don't write dirty entries at destruction time. If bDeep is false, only the global dirty flag of the KConfig object gets cleared. If you then call writeEntry() again, the global dirty flag is set again and all dirty entries will be written at a subsequent sync() call.

Classes that derive from KConfigBase should override this method and implement storage-specific behavior, as well as calling the KConfigBase::rollback() explicitly in the initializer.

Parameters:
bDeepIf true, the dirty flags of all entries are cleared, as well as the global dirty flag.

void  sync ()

sync

[virtual]

Flushes all changes that currently reside only in memory back to disk / permanent storage. Dirty configuration entries are written to the most specific file available.

Asks the back end to flush out all pending writes, and then calls rollback(). No changes are made if the object has readOnly status.

You should call this from your destructor in derivative classes.

See also: rollback(), isReadOnly()

bool  isDirty ()

isDirty

[const]

Checks whether the config file has any dirty (modified) entries.

Returns: true if the config file has any dirty (modified) entries.

void  setReadOnly (bool _ro)

setReadOnly

[virtual]

Sets the config object's read-only status.

Parameters:
_roIf true, the config object will not write out any changes to disk even if it is destroyed or sync() is called.

bool  isReadOnly ()

isReadOnly

[const]

Returns the read-only status of the config object.

Returns: The read-only status.

bool  hasKey ( const QString& key )

hasKey

[const]

Checks whether the key has an entry in the currently active group. Use this to determine whether a key is not specified for the current group (hasKey() returns false). Keys with null data are considered nonexistent.

Parameters:
pKeyThe key to search for.

Returns: If true, the key is available.

QMap<QString, QString>  entryMap (const QString &group)

entryMap

[const pure virtual]

Returns a map (tree) of entries for all entries in a particular group. Only the actual entry string is returned, none of the other internal data should be included.

Parameters:
groupA group to get keys from.

Returns: A map of entries in the group specified, indexed by key. The returned map may be empty if the group is not found.

See also: QMap

void  reparseConfiguration ()

reparseConfiguration

[pure virtual]

Reparses all configuration files. This is useful for programs that use stand alone graphical configuration tools. The base method implemented here only clears the group list and then appends the default group.

Derivative classes should clear any internal data structures and then simply call parseConfigFiles() when implementing this method.

See also: parseConfigFiles()

bool  isImmutable ()

isImmutable

[const]

Checks whether this configuration file can be modified.

Returns: whether changes may be made to this configuration file.

bool  groupIsImmutable (const QString &group)

groupIsImmutable

[const]

Checks whether it is possible to change the given group.

Parameters:
groupthe group to check

Returns: whether changes may be made to group in this configuration file.

bool  entryIsImmutable (const QString &key)

entryIsImmutable

[const]

Checks whether it is possible to change the given entry.

Parameters:
thekey to check

Returns: whether the entry key may be changed in the current group in this configuration file.

enum ConfigState { NoAccess, ReadOnly, ReadWrite }

ConfigState

Possible return values for getConfigState().

See also: getConfigState()

ConfigState  getConfigState ()

getConfigState

[const]

Returns the state of the app-config object.

Possible return values are NoAccess (the application-specific config file could not be opened neither read-write nor read-only), ReadOnly (the application-specific config file is opened read-only, but not read-write) and ReadWrite (the application-specific config file is opened read-write).

Returns: the state of the app-config object

See also: ConfigState()

void  setLocale ()

setLocale

[protected]

Reads the locale and put in the configuration data struct. Note that this should be done in the constructor, but this is not possible due to some mutual dependencies in KApplication::init()

void  setDirty (bool _bDirty = true)

setDirty

[protected virtual]

Sets the global dirty flag of the config object

Parameters:
_bDirtyHow to mark the object's dirty status

void  parseConfigFiles ()

parseConfigFiles

[protected virtual]

Parses all configuration files for a configuration object.

The actual parsing is done by the associated KConfigBackEnd.

KEntryMap  internalEntryMap ( const QString& pGroup )

internalEntryMap

[protected const pure virtual]

Returns a map (tree) of the entries in the specified group. This may or may not return all entries that belong to the config object. The only guarantee that you are given is that any entries that are dirty (i.e. modified and not yet written back to the disk) will be contained in the map. Some derivative classes may choose to return everything.

Do not use this function, the implementation / return type are subject to change.

Parameters:
pGroupThe group to provide a KEntryMap for.

Returns: The map of the entries in the group.

KEntryMap  internalEntryMap ()

internalEntryMap

[protected const pure virtual]

Returns a map (tree) of the entries in the tree.

Do not use this function, the implementation / return type are subject to change.

Returns: A map of the entries in the tree.

void  putData (const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true)

putData

[protected pure virtual]

Inserts a (key/value) pair into the internal storage mechanism of the configuration object. Classes that derive from KConfigBase will need to implement this method in a storage-specific manner.

Do not use this function, the implementation / return type are subject to change.

Parameters:
_keyThe key to insert. It contains information both on the group of the key and the key itself. If the key already exists, the old value will be replaced.
_datathe KEntry that is to be stored.
_checkGroupWhen false, assume that the group already exists.

KEntry  lookupData (const KEntryKey &_key)

lookupData

[protected const pure virtual]

Looks up an entry in the config object's internal structure. Classes that derive from KConfigBase will need to implement this method in a storage-specific manner.

Do not use this function, the implementation and return type are subject to change.

Parameters:
_keyThe key to look up It contains information both on the group of the key and the entry's key itself.

Returns: The KEntry value (data) found for the key. KEntry.aValue will be the null string if nothing was located.

bool  internalHasGroup (const QCString &group)

internalHasGroup

[protected const pure virtual]

KConfigBackEnd * backEnd

backEnd

[protected]

void  setGroup ( const QCString &pGroup )

setGroup

Overloaded public methods:

void  setGroup ( const char *pGroup )

setGroup

bool  hasGroup (const QCString &_pGroup)

hasGroup

[const]

bool  hasGroup (const char *_pGroup)

hasGroup

[const]

bool  hasKey ( const char *pKey )

hasKey

[const]

QCString  readEntryUtf8 ( const char *pKey)

readEntryUtf8

[protected const]

QCString mGroup

mGroup

[protected]

QCString aLocaleString

aLocaleString

[protected]

bool bDirty

bDirty

[protected]

bool bLocaleInitialized

bLocaleInitialized

[protected]

bool bReadOnly

bReadOnly

[protected]

mutable bool bExpand

bExpand

[protected]

void  virtual_hook ( int id, void* data )

virtual_hook

[protected virtual]

Indicates whether there are any dirty entries in the config object that need to be written back to disk.