org.kde.koala

Class KConfigBase

public class KConfigBase extends QObject

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 a group name.

Author: Kalle Dalheimer , Preston Brown

See Also: KGlobal KConfig KSimpleConfig KSharedConfig

UNKNOWN: KDE Configuration Management abstract base class.

Field Summary
static intNoAccess
Possible return values for getConfigState().
static intReadOnly
static intReadWrite
Constructor Summary
protected KConfigBase(Class dummy)
Method Summary
booleancheckConfigFilesWritable(boolean warnUser)
Check whether the config files are writable.
StringclassName()
voiddeleteEntry(String pKey, boolean bNLS, boolean bGlobal)
Deletes the entry specified by pKey in the current group.
voiddeleteEntry(String pKey, boolean bNLS)
voiddeleteEntry(String pKey)
booleandeleteGroup(String group, boolean bDeep, boolean bGlobal)
Deletes a configuration entry group If the group is not empty and bDeep is false, nothing gets deleted and false is returned.
booleandeleteGroup(String group, boolean bDeep)
booleandeleteGroup(String group)
booleanentryIsImmutable(String key)
Checks whether it is possible to change the given entry.
intgetConfigState()
Returns the state of the app-config object.
Stringgroup()
Returns the name of the group in which we are searching for keys and from which we are retrieving entries.
booleangroupIsImmutable(String group)
Checks whether it is possible to change the given group.
ArrayListgroupList()
Returns a list of groups that are known about.
booleanhasDefault(String key)
Returns whether a default is specified for an entry in either the system wide configuration file or the global KDE config file.
booleanhasGroup(String group)
Returns true if the specified group is known about.
booleanhasKey(String key)
Checks whether the key has an entry in the currently active group.
booleanisDirty()
Checks whether the config file has any dirty (modified) entries.
booleanisDollarExpansion()
Returns whether dollar expansion is on or off.
booleanisImmutable()
Checks whether this configuration file can be modified.
booleanisReadOnly()
Returns the read-only status of the config object.
Stringlocale()
Returns a the current locale.
QMetaObjectmetaObject()
booleanreadBoolEntry(String pKey, boolean bDefault)
Reads a booleanean entry.
booleanreadBoolEntry(String pKey)
QColorreadColorEntry(String pKey, QColor pDefault)
Reads a QColor entry.
QColorreadColorEntry(String pKey)
CalendarreadDateTimeEntry(String pKey, Calendar pDefault)
Reads a Calendar entry.
CalendarreadDateTimeEntry(String pKey)
booleanreadDefaults()
doublereadDoubleNumEntry(String pKey, double nDefault)
Reads a floating point value.
doublereadDoubleNumEntry(String pKey)
StringreadEntry(String pKey, String aDefault)
Reads the value of an entry specified by pKey in the current group.
StringreadEntry(String pKey)
StringreadEntryUntranslated(String pKey, String aDefault)
Reads the value of an entry specified by pKey in the current group.
StringreadEntryUntranslated(String pKey)
QFontreadFontEntry(String pKey, QFont pDefault)
Reads a QFont value.
QFontreadFontEntry(String pKey)
int[]readIntListEntry(String pKey)
Reads a list of Integers.
ArrayListreadListEntry(String pKey, char sep)
Reads a list of strings.
ArrayListreadListEntry(String pKey)
ArrayListreadListEntry(String pKey, String[] aDefault, char sep)
Reads a list of strings, but returns a default if the key did not exist.
ArrayListreadListEntry(String pKey, String[] aDefault)
longreadLongNumEntry(String pKey, long nDefault)
Reads a numerical value.
longreadLongNumEntry(String pKey)
longreadNum64Entry(String pKey, long nDefault)
Reads a 64-bit numerical value.
longreadNum64Entry(String pKey)
intreadNumEntry(String pKey, int nDefault)
Reads a numerical value.
intreadNumEntry(String pKey)
StringreadPathEntry(String pKey, String aDefault)
Reads a path.
StringreadPathEntry(String pKey)
ArrayListreadPathListEntry(String pKey, char sep)
Reads a list of string paths.
ArrayListreadPathListEntry(String pKey)
QPointreadPointEntry(String pKey, QPoint pDefault)
Reads a QPoint entry.
QPointreadPointEntry(String pKey)
QVariantreadPropertyEntry(String pKey, QVariant aDefault)
Reads the value of an entry specified by pKey in the current group.
QRectreadRectEntry(String pKey, QRect pDefault)
Reads a QRect entry.
QRectreadRectEntry(String pKey)
QSizereadSizeEntry(String pKey, QSize pDefault)
Reads a QSize entry.
QSizereadSizeEntry(String pKey)
longreadUnsignedLongNumEntry(String pKey, long nDefault)
Read an unsigned numerical value.
longreadUnsignedLongNumEntry(String pKey)
longreadUnsignedNum64Entry(String pKey, long nDefault)
Read an 64-bit unsigned numerical value.
longreadUnsignedNum64Entry(String pKey)
intreadUnsignedNumEntry(String pKey, int nDefault)
Reads an unsigned numerical value.
intreadUnsignedNumEntry(String pKey)
voidreparseConfiguration()
Reparses all configuration files.
voidrevertToDefault(String key)
Reverts the entry with key key in the current group in the application specific config file to either the system wide (default) value or the value specified in the global KDE config file.
voidrollback(boolean bDeep)
Mark the config object as "clean," i.e. don't write dirty entries at destruction time.
voidrollback()
voidsetDesktopGroup()
Sets the group to the "Desktop Entry" group used for desktop configuration files for applications, mime types, etc.
voidsetDollarExpansion(boolean _bExpand)
Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries.
voidsetDollarExpansion()
voidsetGroup(String group)
Specifies the group in which keys will be read and written.
voidsetReadDefaults(boolean b)
When set, all readEntry and readXXXEntry calls return the system wide (default) values instead of the user's preference.
voidsetReadOnly(boolean _ro)
Sets the config object's read-only status.
voidsync()
Flushes all changes that currently reside only in memory back to disk / permanent storage.
voidwriteEntry(String pKey, String pValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a key/value pair.
voidwriteEntry(String pKey, String pValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, String pValue, boolean bPersistent)
voidwriteEntry(String pKey, String pValue)
voidwriteEntry(String pKey, QVariant rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
writeEntry() Overridden to accept a property.
voidwriteEntry(String pKey, QVariant rValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, QVariant rValue, boolean bPersistent)
voidwriteEntry(String pKey, QVariant rValue)
voidwriteEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal, boolean bNLS)
writeEntry() overridden to accept a list of strings.
voidwriteEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, String[] rValue, char sep, boolean bPersistent)
voidwriteEntry(String pKey, String[] rValue, char sep)
voidwriteEntry(String pKey, String[] rValue)
voidwriteEntry(String pKey, int[] rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
writeEntry() overridden to accept a list of Integers.
voidwriteEntry(String pKey, int[] rValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, int[] rValue, boolean bPersistent)
voidwriteEntry(String pKey, int[] rValue)
voidwriteEntry(String pKey, int nValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Write a (key/value) pair.
voidwriteEntry(String pKey, int nValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, int nValue, boolean bPersistent)
voidwriteEntry(String pKey, int nValue)
voidwriteEntry(String pKey, long nValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, long nValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, long nValue, boolean bPersistent)
voidwriteEntry(String pKey, long nValue)
voidwriteEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal, char format, int precision, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal, char format, int precision)
voidwriteEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal, char format)
voidwriteEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, double nValue, boolean bPersistent)
voidwriteEntry(String pKey, double nValue)
voidwriteEntry(String pKey, boolean bValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, boolean bValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, boolean bValue, boolean bPersistent)
voidwriteEntry(String pKey, boolean bValue)
voidwriteEntry(String pKey, QFont rFont, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, QFont rFont, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, QFont rFont, boolean bPersistent)
voidwriteEntry(String pKey, QFont rFont)
voidwriteEntry(String pKey, QColor rColor, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, QColor rColor, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, QColor rColor, boolean bPersistent)
voidwriteEntry(String pKey, QColor rColor)
voidwriteEntry(String pKey, Calendar rDateTime, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, Calendar rDateTime, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, Calendar rDateTime, boolean bPersistent)
voidwriteEntry(String pKey, Calendar rDateTime)
voidwriteEntry(String pKey, QRect rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, QRect rValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, QRect rValue, boolean bPersistent)
voidwriteEntry(String pKey, QRect rValue)
voidwriteEntry(String pKey, QPoint rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, QPoint rValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, QPoint rValue, boolean bPersistent)
voidwriteEntry(String pKey, QPoint rValue)
voidwriteEntry(String pKey, QSize rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair.
voidwriteEntry(String pKey, QSize rValue, boolean bPersistent, boolean bGlobal)
voidwriteEntry(String pKey, QSize rValue, boolean bPersistent)
voidwriteEntry(String pKey, QSize rValue)
voidwritePathEntry(String pKey, String path, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a file path.
voidwritePathEntry(String pKey, String path, boolean bPersistent, boolean bGlobal)
voidwritePathEntry(String pKey, String path, boolean bPersistent)
voidwritePathEntry(String pKey, String path)
voidwritePathEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal, boolean bNLS)
writePathEntry() overridden to accept a list of paths (strings).
voidwritePathEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal)
voidwritePathEntry(String pKey, String[] rValue, char sep, boolean bPersistent)
voidwritePathEntry(String pKey, String[] rValue, char sep)
voidwritePathEntry(String pKey, String[] rValue)

Field Detail

NoAccess

public static final int NoAccess
Possible return values for getConfigState().

See Also: KConfigBase

UNKNOWN: Possible return values for getConfigState().

ReadOnly

public static final int ReadOnly

ReadWrite

public static final int ReadWrite

Constructor Detail

KConfigBase

protected KConfigBase(Class dummy)

Method Detail

checkConfigFilesWritable

public boolean checkConfigFilesWritable(boolean warnUser)
Check whether the config files are writable.

Parameters: warnUser Warn the user if the configuration files are not writable.

Returns: Indicates that all of the configuration files used are writable.

UNKNOWN: Check whether the config files are writable.

className

public String className()

deleteEntry

public void deleteEntry(String pKey, boolean bNLS, boolean bGlobal)
Deletes the entry specified by pKey in the current group.

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

UNKNOWN: Deletes the entry specified by pKey in the current group.

deleteEntry

public void deleteEntry(String pKey, boolean bNLS)

deleteEntry

public void deleteEntry(String pKey)

deleteGroup

public boolean deleteGroup(String group, boolean bDeep, boolean bGlobal)
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: group The name of the group bDeep Specify whether non-empty groups should be completely deleted (including their entries). bGlobal If bGlobal is true, the group is not removed from the application specific config file, but from the global KDE config file.

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

UNKNOWN: Deletes a configuration entry group

deleteGroup

public boolean deleteGroup(String group, boolean bDeep)

deleteGroup

public boolean deleteGroup(String group)

entryIsImmutable

public boolean entryIsImmutable(String key)
Checks whether it is possible to change the given entry.

Parameters: key the key to check

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

UNKNOWN: Checks whether it is possible to change the given entry.

getConfigState

public int getConfigState()
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

UNKNOWN: Returns the state of the app-config object.

group

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

Returns: The current group.

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

groupIsImmutable

public boolean groupIsImmutable(String group)
Checks whether it is possible to change the given group.

Parameters: group the group to check

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

UNKNOWN: Checks whether it is possible to change the given group.

groupList

public ArrayList groupList()
Returns a list of groups that are known about.

Returns: The list of groups.

UNKNOWN: Returns a list of groups that are known about.

hasDefault

public boolean hasDefault(String key)
Returns whether a default is specified for an entry in either the system wide configuration file or the global KDE config file. If an application computes a default value at runtime for a certain entry, e.g. like:
		 QColor computedDefault = kapp.palette().color(QPalette.Active, QColorGroup.Text)
		 QColor color = config.readEntry(key, computedDefault);
		 \encode
			 Then it may wish to make the following check before
		 writing back changes:
		 
		 if ( (value == computedDefault) && !config.hasDefault(key) )
		    config.revertToDefault(key)
		 else
		    config.writeEntry(key, value)
		 
This ensures that as long as the entry is not modified to differ from the computed default, the application will keep using the computed default and will follow changes the computed default makes over time.

Parameters: key The key of the entry to check.

UNKNOWN: Returns whether a default is specified for an entry in either the system wide configuration file or the global KDE config file.

hasGroup

public boolean hasGroup(String group)
Returns true if the specified group is known about.

Parameters: group The group to search for.

Returns: true if the group exists.

UNKNOWN: Returns true if the specified group is known about.

hasKey

public boolean hasKey(String key)
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: key The key to search for.

Returns: If true, the key is available.

UNKNOWN: Checks whether the key has an entry in the currently active group.

isDirty

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

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

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

isDollarExpansion

public boolean isDollarExpansion()
Returns whether dollar expansion is on or off. It is initially OFF.

Returns: true if dollar expansion is on.

UNKNOWN: Returns whether dollar expansion is on or off.

isImmutable

public boolean isImmutable()
Checks whether this configuration file can be modified.

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

UNKNOWN: Checks whether this configuration file can be modified.

isReadOnly

public boolean isReadOnly()
Returns the read-only status of the config object.

Returns: The read-only status.

UNKNOWN: Returns the read-only status of the config object.

locale

public String locale()
Returns a the current locale.

Returns: A string representing the current locale.

UNKNOWN: Returns a the current locale.

metaObject

public QMetaObject metaObject()

readBoolEntry

public boolean readBoolEntry(String pKey, boolean bDefault)
Reads a booleanean entry. Read the value of an entry specified by pKey in the current group and interpret it as a booleanean value. Currently "on" and "true" are accepted as true, everything else if false.

Parameters: pKey The key to search for bDefault A default value returned if the key was not found.

Returns: The value for this key.

UNKNOWN: Reads a boolean entry.

readBoolEntry

public boolean readBoolEntry(String pKey)

readColorEntry

public QColor readColorEntry(String pKey, QColor pDefault)
Reads a QColor entry. Read the value of an entry specified by pKey in the current group and interpret it as a color.

Parameters: pKey The key to search for. pDefault A 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.

UNKNOWN: Reads a QColor entry.

readColorEntry

public QColor readColorEntry(String pKey)

readDateTimeEntry

public Calendar readDateTimeEntry(String pKey, Calendar pDefault)
Reads a Calendar entry. Read the value of an entry specified by pKey in the current group and interpret it as a date and time.

Parameters: pKey The key to search for. pDefault A 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.

UNKNOWN: Reads a QDateTime entry.

readDateTimeEntry

public Calendar readDateTimeEntry(String pKey)

readDefaults

public boolean readDefaults()

Returns: true if all readEntry and readXXXEntry calls return the system wide (default) values instead of the user's preference.

UNKNOWN:

readDoubleNumEntry

public double readDoubleNumEntry(String pKey, double nDefault)
Reads a floating point value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Reads a floating point value.

readDoubleNumEntry

public double readDoubleNumEntry(String pKey)

readEntry

public String readEntry(String pKey, String aDefault)
Reads the value of an entry specified by pKey in the current group. If you want to read a path, please use readPathEntry().

Parameters: pKey The key to search for. aDefault A default value returned if the key was not found.

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

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

readEntry

public String readEntry(String pKey)

readEntryUntranslated

public String readEntryUntranslated(String pKey, String aDefault)
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: pKey The key to search for. aDefault A default value returned if the key was not found.

Returns: The value for this key.

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

readEntryUntranslated

public String readEntryUntranslated(String pKey)

readFontEntry

public QFont readFontEntry(String pKey, QFont pDefault)
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: pKey The key to search for. pDefault A 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.

UNKNOWN: Reads a QFont value.

readFontEntry

public QFont readFontEntry(String pKey)

readIntListEntry

public int[] readIntListEntry(String pKey)
Reads a list of Integers.

Parameters: pKey The key to search for.

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

UNKNOWN: Reads a list of Integers.

readListEntry

public ArrayList readListEntry(String pKey, char sep)
Reads a list of strings.

Parameters: pKey The key to search for. sep The list separator (default is ",").

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

UNKNOWN: Reads a list of strings.

readListEntry

public ArrayList readListEntry(String pKey)

readListEntry

public ArrayList readListEntry(String pKey, String[] aDefault, char sep)
Reads a list of strings, but returns a default if the key did not exist.

Parameters: pKey The key to search for. aDefault The default value to use if the key does not exist. sep The list separator (default is ",").

Returns: The list. Contains aDefault if the Key does not exist.

UNKNOWN: Reads a list of strings, but returns a default if the key did not exist.

readListEntry

public ArrayList readListEntry(String pKey, String[] aDefault)

readLongNumEntry

public long readLongNumEntry(String pKey, long nDefault)
Reads a numerical value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Reads a numerical value.

readLongNumEntry

public long readLongNumEntry(String pKey)

readNum64Entry

public long readNum64Entry(String pKey, long nDefault)
Reads a 64-bit numerical value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Reads a 64-bit numerical value.

readNum64Entry

public long readNum64Entry(String pKey)

readNumEntry

public int readNumEntry(String pKey, int nDefault)
Reads a numerical value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Reads a numerical value.

readNumEntry

public int readNumEntry(String pKey)

readPathEntry

public String readPathEntry(String pKey, String aDefault)
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: pKey The key to search for. aDefault A default value returned if the key was not found.

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

UNKNOWN: Reads a path.

readPathEntry

public String readPathEntry(String pKey)

readPathListEntry

public ArrayList readPathListEntry(String pKey, char sep)
Reads a list of string paths. Read the value of an entry specified by pKey in the current group and interpret it as a list of paths. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

Parameters: pKey The key to search for. sep The list separator (default is ",").

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

UNKNOWN: Reads a list of string paths.

readPathListEntry

public ArrayList readPathListEntry(String pKey)

readPointEntry

public QPoint readPointEntry(String pKey, QPoint pDefault)
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: pKey The key to search for pDefault A 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.

UNKNOWN: Reads a QPoint entry.

readPointEntry

public QPoint readPointEntry(String pKey)

readPropertyEntry

public QVariant readPropertyEntry(String pKey, QVariant aDefault)
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: pKey The key to search for. aDefault A 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.

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

readRectEntry

public QRect readRectEntry(String pKey, QRect pDefault)
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: pKey The key to search for pDefault A 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.

UNKNOWN: Reads a QRect entry.

readRectEntry

public QRect readRectEntry(String pKey)

readSizeEntry

public QSize readSizeEntry(String pKey, QSize pDefault)
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: pKey The key to search for pDefault A 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.

UNKNOWN: Reads a QSize entry.

readSizeEntry

public QSize readSizeEntry(String pKey)

readUnsignedLongNumEntry

public long readUnsignedLongNumEntry(String pKey, long nDefault)
Read an unsigned numerical value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Read an unsigned numerical value.

readUnsignedLongNumEntry

public long readUnsignedLongNumEntry(String pKey)

readUnsignedNum64Entry

public long readUnsignedNum64Entry(String pKey, long nDefault)
Read an 64-bit unsigned numerical value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Read an 64-bit unsigned numerical value.

readUnsignedNum64Entry

public long readUnsignedNum64Entry(String pKey)

readUnsignedNumEntry

public int readUnsignedNumEntry(String pKey, int nDefault)
Reads an unsigned numerical value. Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters: pKey The key to search for. nDefault A default value returned if the key was not found or if the read value cannot be interpreted.

Returns: The value for this key.

UNKNOWN: Reads an unsigned numerical value.

readUnsignedNumEntry

public int readUnsignedNumEntry(String pKey)

reparseConfiguration

public void reparseConfiguration()
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: KConfigBase

UNKNOWN: Reparses all configuration files.

revertToDefault

public void revertToDefault(String key)
Reverts the entry with key key in the current group in the application specific config file to either the system wide (default) value or the value specified in the global KDE config file. To revert entries in the global KDE config file, the global KDE config file should be opened explicitly in a separate config object.

Parameters: key The key of the entry to revert.

UNKNOWN: Reverts the entry with key key in the current group in the application specific config file to either the system wide (default) value or the value specified in the global KDE config file.

rollback

public void rollback(boolean bDeep)
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: bDeep If true, the dirty flags of all entries are cleared, as well as the global dirty flag.

UNKNOWN: Mark the config object as "clean," i.

rollback

public void rollback()

setDesktopGroup

public void setDesktopGroup()
Sets the group to the "Desktop Entry" group used for desktop configuration files for applications, mime types, etc.

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

setDollarExpansion

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

Parameters: _bExpand Tf true, dollar expansion is turned on.

UNKNOWN: Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries.

setDollarExpansion

public void setDollarExpansion()

setGroup

public void setGroup(String group)
Specifies the group in which keys will be read and written. Subsequent calls to readEntry() and writeEntry() will be applied only in the activated group. Switch back to the default group by passing a null string.

Parameters: group The name of the new group.

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

setReadDefaults

public void setReadDefaults(boolean b)
When set, all readEntry and readXXXEntry calls return the system wide (default) values instead of the user's preference. This is off by default.

UNKNOWN: When set, all readEntry and readXXXEntry calls return the system wide (default) values instead of the user's preference.

setReadOnly

public void setReadOnly(boolean _ro)
Sets the config object's read-only status.

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

UNKNOWN: Sets the config object's read-only status.

sync

public void sync()
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: KConfigBase KConfigBase

UNKNOWN: Flushes all changes that currently reside only in memory back to disk / permanent storage.

writeEntry

public void writeEntry(String pKey, String pValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a key/value pair. This is stored in the most specific config file when destroying the config object or when calling sync(). If you want to write a path, please use writePathEntry().

Parameters: pKey The key to write. pValue The value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a key/value pair.

writeEntry

public void writeEntry(String pKey, String pValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, String pValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, String pValue)

writeEntry

public void writeEntry(String pKey, QVariant rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
writeEntry() Overridden to accept a property. Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters: pKey The key to write rValue The property to write bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

See Also: KConfigBase

UNKNOWN: writeEntry() Overridden to accept a property.

writeEntry

public void writeEntry(String pKey, QVariant rValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, QVariant rValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, QVariant rValue)

writeEntry

public void writeEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal, boolean bNLS)
writeEntry() overridden to accept a list of strings. Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters: pKey The key to write rValue The list to write sep The list separator (default is ","). bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

See Also: KConfigBase

UNKNOWN: writeEntry() overridden to accept a list of strings.

writeEntry

public void writeEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, String[] rValue, char sep, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, String[] rValue, char sep)

writeEntry

public void writeEntry(String pKey, String[] rValue)

writeEntry

public void writeEntry(String pKey, int[] rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
writeEntry() overridden to accept a list of Integers. Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters: pKey The key to write rValue The list to write bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

See Also: KConfigBase

UNKNOWN: writeEntry() overridden to accept a list of Integers.

writeEntry

public void writeEntry(String pKey, int[] rValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, int[] rValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, int[] rValue)

writeEntry

public void writeEntry(String pKey, int nValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Write a (key/value) pair. Same as above, but writes a numerical value.

Parameters: pKey The key to write. nValue The value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Write a (key/value) pair.

writeEntry

public void writeEntry(String pKey, int nValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, int nValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, int nValue)

writeEntry

public void writeEntry(String pKey, long nValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair. Same as above, but write a long numerical value.

Parameters: pKey The key to write. nValue The value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, long nValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, long nValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, long nValue)

writeEntry

public void writeEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal, char format, int precision, boolean bNLS)
Writes a (key/value) pair. Same as above, but writes a floating-point value.

Parameters: pKey The key to write. nValue The value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. format format determines the format to which the value is converted. Default is 'g'. precision precision sets the precision with which the value is converted. Default is 6 as in String. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal, char format, int precision)

writeEntry

public void writeEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal, char format)

writeEntry

public void writeEntry(String pKey, double nValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, double nValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, double nValue)

writeEntry

public void writeEntry(String pKey, boolean bValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair. Same as above, but writes a booleanean value.

Parameters: pKey The key to write. bValue The value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, boolean bValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, boolean bValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, boolean bValue)

writeEntry

public void writeEntry(String pKey, QFont rFont, boolean bPersistent, boolean bGlobal, boolean bNLS)
Writes a (key/value) pair. Same as above, but writes a font value.

Parameters: pKey The key to write. rFont The font value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, QFont rFont, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, QFont rFont, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, QFont rFont)

writeEntry

public void writeEntry(String pKey, QColor rColor, boolean bPersistent, boolean bGlobal, boolean bNLS)
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: pKey The key to write. rColor The color value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, QColor rColor, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, QColor rColor, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, QColor rColor)

writeEntry

public void writeEntry(String pKey, Calendar rDateTime, boolean bPersistent, boolean bGlobal, boolean bNLS)
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: pKey The key to write. rDateTime The date and time value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, Calendar rDateTime, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, Calendar rDateTime, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, Calendar rDateTime)

writeEntry

public void writeEntry(String pKey, QRect rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
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: pKey The key to write. rValue The rectangle value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, QRect rValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, QRect rValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, QRect rValue)

writeEntry

public void writeEntry(String pKey, QPoint rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
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: pKey The key to write. rValue The point value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, QPoint rValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, QPoint rValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, QPoint rValue)

writeEntry

public void writeEntry(String pKey, QSize rValue, boolean bPersistent, boolean bGlobal, boolean bNLS)
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: pKey The key to write. rValue The size value to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a (key/value) pair.

writeEntry

public void writeEntry(String pKey, QSize rValue, boolean bPersistent, boolean bGlobal)

writeEntry

public void writeEntry(String pKey, QSize rValue, boolean bPersistent)

writeEntry

public void writeEntry(String pKey, QSize rValue)

writePathEntry

public void writePathEntry(String pKey, String path, boolean bPersistent, boolean bGlobal, boolean bNLS)
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: pKey The key to write. path The path to write. bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

UNKNOWN: Writes a file path.

writePathEntry

public void writePathEntry(String pKey, String path, boolean bPersistent, boolean bGlobal)

writePathEntry

public void writePathEntry(String pKey, String path, boolean bPersistent)

writePathEntry

public void writePathEntry(String pKey, String path)

writePathEntry

public void writePathEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal, boolean bNLS)
writePathEntry() overridden to accept a list of paths (strings). It is checked whether the paths are located under $HOME. If so each of the paths are written out with the user's home-directory replaced with $HOME. The paths should be read back with readPathListEntry()

Parameters: pKey The key to write rValue The list to write sep The list separator (default is ","). bPersistent If 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. bGlobal If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file. bNLS If bNLS is true, the locale tag is added to the key when writing it back.

See Also: KConfigBase KConfigBase

UNKNOWN: writePathEntry() overridden to accept a list of paths (strings).

writePathEntry

public void writePathEntry(String pKey, String[] rValue, char sep, boolean bPersistent, boolean bGlobal)

writePathEntry

public void writePathEntry(String pKey, String[] rValue, char sep, boolean bPersistent)

writePathEntry

public void writePathEntry(String pKey, String[] rValue, char sep)

writePathEntry

public void writePathEntry(String pKey, String[] rValue)