class KConfigBase
|
KDE Configuration Management abstract base class. More... |
|
|
Public Types
Public Methods
- KConfigBase ()
- virtual ~ KConfigBase ()
- void setGroup ( const QString& pGroup )
- void setDesktopGroup ()
- QString group () const
- virtual bool hasGroup (const QString &_pGroup) const
- virtual QStringList groupList () const
- QString locale () const
- QString readEntry ( const QString& pKey, const QString& aDefault = QString::null ) const
- QString readEntry ( const char *pKey, const QString& aDefault = QString::null ) const
- QVariant readPropertyEntry ( const QString& pKey, QVariant::Type ) const
- QVariant readPropertyEntry ( const char *pKey, QVariant::Type ) const
- int readListEntry ( const QString& pKey, QStrList &list, char sep = ',' ) const
- int readListEntry ( const char *pKey, QStrList &list, char sep = ',' ) const
- QStringList readListEntry ( const QString& pKey, char sep = ',' ) const
- QStringList readListEntry ( const char *pKey, char sep = ',' ) const
- QValueList readIntListEntry ( const QString& pKey ) const
- QValueList readIntListEntry ( const char *pKey ) const
- QString readPathEntry ( const QString& pKey, const QString & aDefault = QString::null ) const
- QString readPathEntry ( const char *pKey, const QString & aDefault = QString::null ) const
- int readNumEntry ( const QString& pKey, int nDefault = 0 ) const
- int readNumEntry ( const char *pKey, int nDefault = 0 ) const
- unsigned int readUnsignedNumEntry ( const QString& pKey, unsigned int nDefault = 0 ) const
- unsigned int readUnsignedNumEntry ( const char *pKey, unsigned int nDefault = 0 ) const
- long readLongNumEntry ( const QString& pKey, long nDefault = 0 ) const
- long readLongNumEntry ( const char *pKey, long nDefault = 0 ) const
- unsigned long readUnsignedLongNumEntry ( const QString& pKey, unsigned long nDefault = 0 ) const
- unsigned long readUnsignedLongNumEntry ( const char *pKey, unsigned long nDefault = 0 ) const
- double readDoubleNumEntry ( const QString& pKey, double nDefault = 0.0 ) const
- double readDoubleNumEntry ( const char *pKey, double nDefault = 0.0 ) const
- QFont readFontEntry ( const QString& pKey, const QFont* pDefault = 0L ) const
- QFont readFontEntry ( const char *pKey, const QFont* pDefault = 0L ) const
- bool readBoolEntry ( const QString& pKey, const bool bDefault = false ) const
- bool readBoolEntry ( const char *pKey, const bool bDefault = false ) const
- QRect readRectEntry ( const QString& pKey, const QRect* pDefault = 0L ) const
- QRect readRectEntry ( const char *pKey, const QRect* pDefault = 0L ) const
- QPoint readPointEntry ( const QString& pKey, const QPoint* pDefault = 0L ) const
- QPoint readPointEntry ( const char *pKey, const QPoint* pDefault = 0L ) const
- QSize readSizeEntry ( const QString& pKey, const QSize* pDefault = 0L ) const
- QSize readSizeEntry ( const char *pKey, const QSize* pDefault = 0L ) const
- QColor readColorEntry ( const QString& pKey, const QColor* pDefault = 0L ) const
- QColor readColorEntry ( const char *pKey, const QColor* pDefault = 0L ) const
- QDateTime readDateTimeEntry ( const QString& pKey, const QDateTime* pDefault = 0L ) const
- QDateTime readDateTimeEntry ( const char *pKey, const QDateTime* pDefault = 0L ) const
- QString writeEntry ( const QString& pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QVariant& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QVariant& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QStrList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QStrList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, const char *pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, const char *pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false )
- QString writeEntry ( const char *pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false )
- QString writeEntry ( const QString& pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const QString& pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- QString writeEntry ( const char *pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QDateTime& rDateTime, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QDateTime& rDateTime, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const QString& pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void writeEntry ( const char *pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
- void setDollarExpansion ( bool _bExpand = true )
- bool isDollarExpansion () const
- virtual void rollback ( bool bDeep = true )
- virtual void sync ()
- bool isDirty () const
- virtual void setReadOnly (bool _ro)
- bool isReadOnly () const
- virtual bool hasKey ( const QString& pKey ) const
- virtual QMap entryMap (const QString &pGroup) const
- virtual void reparseConfiguration ()
- ConfigState getConfigState () const
- void setGroup ( const QCString &pGroup )
- void setGroup ( const char *pGroup )
- virtual bool hasGroup (const QCString &_pGroup) const
- virtual bool hasGroup (const char *_pGroup) const
- virtual bool hasKey ( const char *pKey ) const
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.
See also: KConfig, KSimpleConfig, KSimpleConfig
Construct a KConfigBase object.
[virtual]
Destructor.
void setGroup ( const QString& pGroup )
|
Specify the group in which keys will be searched.
Subsequent
calls to readEntry() will look only for keys in the currently
activated group.
Switch back to the default group by passing an empty string.
Parameters:
| |
Set the group to the "Desktop Entry" group used for
desktop configuration files for applications, mime types, etc.
[const]
Retrieve 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 &_pGroup)
|
[const pure virtual]
Returns true
if the specified group is known about.
Parameters:
| |
Returns: Whether the group exists.
[const pure virtual]
Retrieve a list of groups that are known about.
Returns: The list of groups.
[const]
Retrieve a the current locale.
Returns: A string representing the current locale.
QString readEntry ( const QString& pKey, const QString& aDefault = QString::null )
|
[const]
Read the value of an entry specified by pKey
in the current group.
Parameters:
| |
Returns: The value for this key or a null string if no value
was found.
QString readEntry ( const char *pKey, const QString& aDefault = QString::null )
|
[const]
QVariant readPropertyEntry ( const QString& pKey, QVariant::Type )
|
[const]
Read the value of an entry specified by pKey
in the current group.
The value is treated as if it is of the given type.
Returns: An empty property or error.
QVariant readPropertyEntry ( const char *pKey, QVariant::Type )
|
[const]
int readListEntry ( const QString& pKey, QStrList &list, char sep = ',' )
|
[const]
Read a list of strings.
Parameters:
| |
Returns: The number of entries in the list.
int readListEntry ( const char *pKey, QStrList &list, char sep = ',' )
|
[const]
QStringList readListEntry ( const QString& pKey, char sep = ',' )
|
[const]
Read a list of strings.
Parameters:
| |
Returns: The list.
QStringList readListEntry ( const char *pKey, char sep = ',' )
|
[const]
QValueList readIntListEntry ( const QString& pKey )
|
[const]
Read a list of Integers.
Parameters:
| |
Returns: The list.
QValueList readIntListEntry ( const char *pKey )
|
[const]
QString readPathEntry ( const QString& pKey, const QString & aDefault = QString::null )
|
[const]
Read 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:
| |
Returns: The value for this key or a null string if no value was found.
QString readPathEntry ( const char *pKey, const QString & aDefault = QString::null )
|
[const]
int readNumEntry ( const QString& pKey, int nDefault = 0 )
|
[const]
Read a numerical value.
Read the value of an entry specified by pKey
in the current group
and interpret it numerically.
Parameters:
| |
Returns: The value for this key or 0 if no value was found.
int readNumEntry ( const char *pKey, int nDefault = 0 )
|
[const]
unsigned int readUnsignedNumEntry ( const QString& pKey, unsigned int nDefault = 0 )
|
[const]
Read a numerical value.
Read the value of an entry specified by pKey
in the current group
and interpret it numerically.
Parameters:
| |
Returns: The value for this key or 0 if no value was found.
unsigned int readUnsignedNumEntry ( const char *pKey, unsigned int nDefault = 0 )
|
[const]
long readLongNumEntry ( const QString& pKey, long nDefault = 0 )
|
[const]
Read a numerical value.
Read the value of an entry specified by pKey
in the current group
and interpret it numerically.
Parameters:
| |
Returns: The value for this key or 0 if no value was found.
long readLongNumEntry ( const char *pKey, long nDefault = 0 )
|
[const]
unsigned long readUnsignedLongNumEntry ( const QString& pKey, unsigned long nDefault = 0 )
|
[const]
Read a numerical value.
Read the value of an entry specified by pKey
in the current group
and interpret it numerically.
Parameters:
| |
Returns: The value for this key or 0 if no value was found.
unsigned long readUnsignedLongNumEntry ( const char *pKey, unsigned long nDefault = 0 )
|
[const]
double readDoubleNumEntry ( const QString& pKey, double nDefault = 0.0 )
|
[const]
Read a numerical value.
Read the value of an entry specified by pKey
in the current group
and interpret it numerically.
Parameters:
| |
Returns: The value for this key or 0 if no value was found.
double readDoubleNumEntry ( const char *pKey, double nDefault = 0.0 )
|
[const]
QFont readFontEntry ( const QString& pKey, const QFont* pDefault = 0L )
|
[const]
Read a QFont.
Read the value of an entry specified by pKey
in the current group
and interpret it as a font object.
Parameters:
| |
Returns: The value for this key or a default font if no value was found.
QFont readFontEntry ( const char *pKey, const QFont* pDefault = 0L )
|
[const]
bool readBoolEntry ( const QString& pKey, const bool bDefault = false )
|
[const]
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:
| |
Returns: The value for this key or a default value if no value was
found.
bool readBoolEntry ( const char *pKey, const bool bDefault = false )
|
[const]
QRect readRectEntry ( const QString& pKey, const QRect* pDefault = 0L )
|
[const]
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:
| |
Returns: The value for this key or a default rectangle if no value
was found.
QRect readRectEntry ( const char *pKey, const QRect* pDefault = 0L )
|
[const]
QPoint readPointEntry ( const QString& pKey, const QPoint* pDefault = 0L )
|
[const]
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:
| |
Returns: The value for this key or a default point if no value
was found.
QPoint readPointEntry ( const char *pKey, const QPoint* pDefault = 0L )
|
[const]
QSize readSizeEntry ( const QString& pKey, const QSize* pDefault = 0L )
|
[const]
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:
| |
Returns: The value for this key or a default point if no value
was found.
QSize readSizeEntry ( const char *pKey, const QSize* pDefault = 0L )
|
[const]
QColor readColorEntry ( const QString& pKey, const QColor* pDefault = 0L )
|
[const]
Read a QColor.
Read the value of an entry specified by pKey
in the current group
and interpret it as a color.
Parameters:
| |
Returns: The value for this key or a default color if no value
was found.
QColor readColorEntry ( const char *pKey, const QColor* pDefault = 0L )
|
[const]
[const]
Read a QDateTime.
Read the value of an entry specified by pKey
in the current group
and interpret it as a date and time.
Parameters:
| |
Returns: The value for this key or a currentDateTime()
(Qt global function) if no value was found.
[const]
QString writeEntry ( const QString& pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
Write the key/value pair.
This is stored in the most specific config file when destroying the
config object or when calling sync().
Parameters:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QVariant& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
writeEntry() Overridden to accept a property.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QVariant& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QStrList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
writeEntry() overriden to accept a list of strings.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QStrList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
writeEntry() overridden to accept a list of strings.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
writeEntry() overridden to accept a list of Integers.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, const char *pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false )
|
Write the key value pair.
Same as above, but write a floating-point value.*
Parameters:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
QString writeEntry ( const QString& 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:
| |
Returns: The old value for this key. If this key did not
exist, a null string is returned.
QString writeEntry ( const char *pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
Write the key value pair.
Same as above, but write a color.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QDateTime& rDateTime, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
Write the key value pair.
Same as above, but write a date and time.
Note: Unlike the other writeEntry() functions, the old value is
not returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QDateTime& rDateTime, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
Write the key value pair.
Same as above, but write a rectangle.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
Write the key value pair.
Same as above, but write a point.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void writeEntry ( const QString& pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
Write the key value pair.
Same as above, but write a size.
Note: Unlike the other writeEntry() functions, the old value is
_not_ returned here!
Parameters:
| |
void writeEntry ( const char *pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )
|
void setDollarExpansion ( bool _bExpand = true )
|
Turns on or off "dollar expansion" (see KConfigBase introduction)
when reading config entries.
Dollar sign expansion is initially OFF.
Parameters:
| |
bool 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 )
|
[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 KConfigObject should override this
method and implement storage-specific behaviour, as well as
calling the KConfigBase::rollback() explicitly in the initializer.
Parameters:
| |
[virtual]
Flush 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()
[const]
Returns: true
if the config file has any dirty (modified) entries.
void setReadOnly (bool _ro)
|
[virtual]
Set the config object's read-only status.
Parameters:
| |
[const]
Queries the read-only status of the config object.
Returns: The read-only status.
bool hasKey ( const QString& pKey )
|
[const pure virtual]
Check 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:
| |
Returns: If true, the key is available.
QMap entryMap (const QString &pGroup)
|
[const pure virtual]
Return 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:
| |
Returns: A map of entries in the group specified, indexed by key.
The returned map may be empty if the group is not found.
void reparseConfiguration ()
|
[pure virtual]
Reparses all configuration files. This is useful for programs
that use standalone 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.
enum ConfigState {NoAccess, ReadOnly, ReadWrite }
|
Possible return values for getConfigState().
ConfigState getConfigState ()
|
[const]
Retrieve 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).
[protected]
Read 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)
|
[protected virtual]
Sets the global dirty flag of the config object
Parameters:
| |
[protected virtual]
Parse all configuration files for a configuration object.
The actual parsing is done by the associated KConfigBackEnd.
KEntryMap internalEntryMap ( const QString& pGroup )
|
[protected const pure virtual]
Returns an 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:
| |
Returns: The map of the entries in the group.
[protected const pure virtual]
Returns an 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.
[protected pure virtual]
Insert 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:
| |
[protected const pure virtual]
Look 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:
| |
Returns: The KEntry value (data) found for the key. KEntry.aValue
will be the null string if nothing was located.
[protected]
A back end for loading/saving to disk in a particular format.
void setGroup ( const QCString &pGroup )
|
Overloaded public methods:
void setGroup ( const char *pGroup )
|
bool hasGroup (const QCString &_pGroup)
|
[const pure virtual]
bool hasGroup (const char *_pGroup)
|
[const pure virtual]
bool hasKey ( const char *pKey )
|
[const pure virtual]
QCString readEntryUtf8 ( const char *pKey)
|
[protected const]
[protected]
The currently selected group.
[protected]
The locale to retrieve keys under if possible, i.e en_US or fr.
[protected]
Indicates whether there are any dirty entries in the config object
that need to be written back to disk.
[protected]
[protected]
[protected]
[protected]
inline void rollback ( bool )
|
[protected]
- Version: $Id: kconfigbase.h,v 1.49 2000/09/25 03:53:04 waba Exp $
- Author: Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org>
- Generated: prospector@porky.devel.redhat.com on Fri Nov 3 09:58:39 2000, using kdoc 2.0a42.