[kdecore Index] [kdecore Hierarchy] [Headers]
KDE Configuration Management abstract base class More...
#include <kconfigbase.h>
Inherits: QObject (qt)
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 like ksamba). one application, independent of the configuration files they came from.
All configuration entries are of the form "key=value" and belong to a certain group. A group can be specified in a configuration file with "[GroupName]". All configuration entries from the beginning of a configuration file to the first group declaration belong to a special group called the default group.
If there is a $ character in a entry, KConfig 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.
Lines starting with a hash mark(#) are comment lines.
See Also: KApplication
[public]
Construct a KConfigBase object.
[public virtual]
Destructor.
Writes back any dirty configuration entries.
[public]
Specify the group in which keys will be searched.
Switch back to the default group by passing an empty string.
pGroup | The name of the new group. |
[public]
Retrieve the group where keys are currently searched in.
[public]
Retrieve the group where keys are currently searched in. Note: this method is deprecated; use KConfigBase::group() instead.
[public]
Read the value of an entry specified by rKey in the current group
pKey | The key to search for. |
pDefault | A default value returned if the key was not found. |
[public]
Read a list of strings.
sep | The list separator (default ",") |
pKey | The key to search for |
list | In this object, the read list will be returned. |
[public]
Read a numerical value.
Read the value of an entry specified by rKey in the current group and interpret it numerically.
pKey | The key to search for. |
nDefault | A default value returned if the key was not found. |
[public]
Read a numerical value.
Read the value of an entry specified by rKey in the current group and interpret it numerically.
pKey | The key to search for. |
nDefault | A default value returned if the key was not found. |
[public]
Read a numerical value.
Read the value of an entry specified by rKey in the current group and interpret it numerically.
pKey | The key to search for. |
nDefault | A default value returned if the key was not found. |
[public]
Read a numerical value.
Read the value of an entry specified by rKey in the current group and interpret it numerically.
pKey | The key to search for. |
nDefault | A default value returned if the key was not found. |
[public]
Read a numerical value.
Read the value of an entry specified by rKey in the current group and interpret it numerically.
pKey | The key to search for. |
nDefault | A default value returned if the key was not found. |
[public]
Read a QFont.
Read the value of an entry specified by rKey in the current group and interpret it as a font object.
pKey | The key to search for. |
pDefault | A default value returned if the key was not found. |
[public]
Read 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.
pKey | The key to search for |
bDefault | A default value returned if the key was not found. |
[public]
Read a rect entry.
Read the value of an entry specified by pKey in the current group and interpret it as a QRect object.
pKey | The key to search for |
pDefault | A default value returned if the key was not found. |
[public]
Read a point entry.
Read the value of an entry specified by pKey in the current group and interpret it as a QPoint object.
pKey | The key to search for |
pDefault | A default value returned if the key was not found. |
[public]
Read a size entry.
Read the value of an entry specified by pKey in the current group and interpret it as a QSize object.
pKey | The key to search for |
pDefault | A default value returned if the key was not found. |
[public]
Read a QColor.
Read the value of an entry specified by rKey in the current group and interpret it as a color.
pKey | The key to search for. |
pDefault | A default value returned if the key was not found. |
[public]
Write the key/value pair. This is stored to the most specific config file when destroying the config object or when calling sync().
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
pValue | The value to write. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
writeEntry() overriden to accept a list of strings.
Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!
sep | The list separator |
pKey | The key to write |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
list | The list to write |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write a numerical value.
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
nValue | The value to write. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write an unsigned numerical value.
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
nValue | The value to write. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write a long numerical value.
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
nValue | The value to write. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write an unsigned long numerical value.
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
nValue | The value to write. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write a floating-point value.
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
nValue | The value to write. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write a boolean value.
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
bValue | The value to write. |
[public]
Write the key value pair.Same as above, but write a font
rFont | The font value to write. |
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
[public]
Write the key value pair.Same as above, but write a color
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
rValue | The color value to write. |
[public]
Write the key value pair.Same as above, but write a rectangle
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
rValue | The rectangle value to write. |
[public]
Write the key value pair.Same as above, but write a point
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
rValue | The point value to write. |
[public]
Write the key value pair.Same as above, but write a size
pKey | The key to write. |
bGlobal | If bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc |
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. |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
rValue | The size value to write. |
[public]
Turns on or off "dollar expansion" when reading config entries.
bExpand | if true, dollar expansion is turned on. |
[public]
Returns whether dollar expansion is on or off.
[public virtual]
Don't write dirty entries at destruction time. If bDeep isfalse, 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.
bDeep | if true, the dirty flags of all entries are cleared, as well as the global dirty flag. |
[public virtual]
Flush the entry cache. Write back dirty configuration entries tothe most specific file. This is called automatically from the destructor. This method must be implemented by the derived classes.
[public]
Check if the key has an entry in the specified groupUse this to determine if a key is not specified for the current group (HasKey returns false) or is specified but has no value ("key =EOL"; Has Key returns true, ReadEntry returns an empty string)
pKey | The key to search for. |
[public]
Returns an iterator on the list of groups
[public]
Returns an iterator on the entries in the current group
pGroup | the group to provide an iterator for |
[public virtual]
Reparses all configuration files. This is useful for programmswhich use standalone graphical configuration tools.
[protected]
Access to the configuration data.
[protected]
Read the locale and put in the configuration data struct. Note: This should be done in the constructor, but this is not possible due to some mutual dependencies in KApplication::init()
[protected virtual]
Parse all configuration files for a configuration object. This method must be reimplemented by the derived classes. It should go through the list of appropriate files for a configuration object, open the files and call parseOneConfigFile() for each one of them.
[protected virtual]
Parse one configuration file. This method contains the actual configuration file parser. It can overridden by derived classes for specific parsing needs. For normal use, this should not be necessary.
rFile | The configuration file to parse |
bGlobal | |
pGroup |
[protected virtual]
Write configuration file back. This method must be reimplemented by derived classes. It should dump the data of the configuration object to the appropriate files.
rFile | The file to write |
bGlobal | Should the data be saved to a global file |
| Kdoc |