|
|
KConfigBaseData* data () |
Access to the configuration data.
Returns: a pointer to the configuration base data
void setLocale () |
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()
void parseConfigFiles () |
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.
void parseOneConfigFile ( QFile& rFile, KGroupDict* pGroup = 0L, bool bGlobal = false ) |
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.
Parameters:
rFile | The configuration file to parse |
bGlobal |
bool writeConfigFile ( QFile& rFile, bool bGlobal = false ) |
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.
Parameters:
rFile | The file to write |
bGlobal | Should the data be saved to a global file |
Returns: Whether some entries are left to be written to other files.
KConfigBase () |
Construct a KConfigBase object.
~KConfigBase () |
Destructor.
Writes back any dirty configuration entries.
void setGroup ( const char* pGroup ) |
Specify the group in which keys will be searched.
Switch back to the default group by passing an empty string.
Parameters:
pGroup | The name of the new group. |
const char* group () |
Retrieve the group where keys are currently searched in.
Returns: The current group
const char* getGroup () |
Retrieve the group where keys are currently searched in. Note: this method is deprecated; use KConfigBase::group() instead.
Returns: The current group
const QString readEntry ( const char* pKey, const char* pDefault = 0L ) |
Read the value of an entry specified by rKey in the current group
Parameters:
pKey | The key to search for. |
pDefault | A default value returned if the key was not found. |
Returns: The value for this key or an empty string if no value was found.
int readListEntry ( const char* pKey, QStrList &list, char sep = ',' ) |
Read a list of strings.
Parameters:
pKey | The key to search for |
list | In this object, the read list will be returned. |
sep | The list separator (default ",") |
Returns: The number of entries in the list.
int readNumEntry ( const char* pKey, int nDefault = 0 ) |
Read a numerical value.
Read the value of an entry specified by rKey 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. |
Returns: The value for this key or 0 if no value was found.
unsigned int readUnsignedNumEntry ( const char* pKey, unsigned int nDefault = 0 ) |
Read a numerical value.
Read the value of an entry specified by rKey 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. |
Returns: The value for this key or 0 if no value was found.
long readLongNumEntry ( const char* pKey, long nDefault = 0 ) |
Read a numerical value.
Read the value of an entry specified by rKey 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. |
Returns: The value for this key or 0 if no value was found.
unsigned long readUnsignedLongNumEntry ( const char* pKey, unsigned long nDefault = 0 ) |
Read a numerical value.
Read the value of an entry specified by rKey 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. |
Returns: The value for this key or 0 if no value was found.
double readDoubleNumEntry ( const char* pKey, double nDefault = 0.0 ) |
Read a numerical value.
Read the value of an entry specified by rKey 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. |
Returns: The value for this key or 0 if no value was found.
QFont readFontEntry ( const char* pKey, const QFont* pDefault = 0L ) |
Read a QFont.
Read the value of an entry specified by rKey in the current group and interpret it as a font object.
Parameters:
pKey | The key to search for. |
pDefault | A default value returned if the key was not found. |
Returns: The value for this key or a default font if no value was found.
bool readBoolEntry ( const char* pKey, const bool bDefault = false ) |
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.
Parameters:
pKey | The key to search for |
bDefault | A default value returned if the key was not found. |
Returns: The value for this key or a default value if no value was found.
QRect readRectEntry ( const char* pKey, const QRect* pDefault = 0L ) |
Read a rect 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 returned if the key was not found. |
Returns: The value for this key or a default rectangle if no value was found.
QPoint readPointEntry ( const char* pKey, const QPoint* pDefault = 0L ) |
Read a point 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 returned if the key was not found. |
Returns: The value for this key or a default point if no value was found.
QSize readSizeEntry ( const char* pKey, const QSize* pDefault = 0L ) |
Read a size 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 returned if the key was not found. |
Returns: The value for this key or a default point if no value was found.
QColor readColorEntry ( const char* pKey, const QColor* pDefault = 0L ) |
Read a QColor.
Read the value of an entry specified by rKey in the current group and interpret it as a color.
Parameters:
pKey | The key to search for. |
pDefault | A default value returned if the key was not found. |
Returns: The value for this key or a default color if no value was found.
const char* writeEntry ( const char* pKey, const char* pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key/value pair.
This is stored to the most specific config file when destroying the config object or when calling sync().
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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
void writeEntry ( const char* pKey, QStrList &list, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
writeEntry() overriden 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 |
list | The list to write |
sep | The list separator |
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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
See also: writeEntry
const char* writeEntry ( const char* pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
const char* writeEntry ( const char* pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write an unsigned 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
const char* writeEntry ( const char* pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
const char* writeEntry ( const char* pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write an unsigned 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
const char* writeEntry ( const char* pKey, double nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
const char* writeEntry ( const char* pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write a boolean 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
const char* writeEntry ( const char* pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write a font
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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
void writeEntry ( const char* pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write a color
Parameters:
pKey | The key to write. |
rValue | 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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
void writeEntry ( const char* pKey, const QRect& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write a rectangle
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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
void writeEntry ( const char* pKey, const QPoint& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write a point
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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
void writeEntry ( const char* pKey, const QSize& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ) |
Write the key value pair. Same as above, but write a size
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 ~/.kderc |
bNLS | If bNLS is true, the locale tag is added to the key when writing it back. |
Returns: The old value for this key. If this key did not exist, a null string is returned.
void setDollarExpansion ( bool bExpand = true ) |
Turns on or off "dollar expansion" when reading config entries.
Parameters:
bExpand | if true, dollar expansion is turned on. |
bool isDollarExpansion () |
Returns whether dollar expansion is on or off.
Returns: true if dollar expansion is on.
void rollback ( bool bDeep = true ) |
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.
Parameters:
bDeep | if true, the dirty flags of all entries are cleared, as well as the global dirty flag. |
void sync () |
Flush the entry cache. Write back dirty configuration entries to the most specific file. This is called automatically from the destructor. This method must be implemented by the derived classes.
bool hasKey ( const char* pKey ) |
Check if the key has an entry in the specified group Use 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)
Parameters:
pKey | The key to search for. |
Returns: if true, the key is available
KGroupIterator* groupIterator (void) |
Returns an iterator on the list of groups
Returns: The group iterator. The caller is reponsable for deleting the iterator after using it.
KEntryIterator* entryIterator ( const char* pGroup ) |
Returns an iterator on the entries in the current group
Parameters:
pGroup | the group to provide an iterator for |
Returns: The iterator for the group or 0, if the group does not exist. The caller is responsible for deleting the iterator after using it.
void reparseConfiguration () |
Reparses all configuration files. This is useful for programms which use standalone graphical configuration tools.
Generated by: bhcompile@stripples.devel.redhat.com on Thu Jul 26 13:37:38 200. |