KConfig 5.109.0
|
Interface to interact with configuration. More...
#include <KConfigBase>
Public Types | |
enum | AccessMode { NoAccess , ReadOnly , ReadWrite } |
Possible return values for accessMode(). More... | |
enum | WriteConfigFlag { Persistent = 0x01 , Global = 0x02 , Localized = 0x04 , Notify = 0x08 | Persistent , Normal = Persistent } |
Flags to control write entry. More... | |
typedef QFlags< WriteConfigFlag > | WriteConfigFlags |
Stores a combination of #WriteConfigFlag values. | |
Public Member Functions | |
virtual | ~KConfigBase () |
Destructs the KConfigBase object. | |
virtual AccessMode | accessMode () const =0 |
Returns the access mode of the app-config object. | |
void | deleteGroup (const char *group, WriteConfigFlags flags=Normal) |
Overload for deleteGroup(const QString&, WriteConfigFlags) | |
void | deleteGroup (const QByteArray &group, WriteConfigFlags flags=Normal) |
Overload for deleteGroup(const QString&, WriteConfigFlags) | |
void | deleteGroup (const QString &group, WriteConfigFlags flags=Normal) |
Delete group . | |
KConfigGroup | group (const char *group) |
Overload for group(const QString&) | |
const KConfigGroup | group (const char *group) const |
Const overload for group(const QString&) | |
KConfigGroup | group (const QByteArray &group) |
Overload for group(const QString&) | |
const KConfigGroup | group (const QByteArray &group) const |
Const overload for group(const QString&) | |
KConfigGroup | group (const QString &group) |
Returns an object for the named subgroup. | |
const KConfigGroup | group (const QString &group) const |
Const overload for group(const QString&) | |
virtual QStringList | groupList () const =0 |
Returns a list of groups that are known about. | |
bool | hasGroup (const char *group) const |
Overload for hasGroup(const QString&) const. | |
bool | hasGroup (const QByteArray &group) const |
Overload for hasGroup(const QString&) const. | |
bool | hasGroup (const QString &group) const |
Returns true if the specified group is known about. | |
bool | isGroupImmutable (const char *group) const |
Overload for isGroupImmutable(const QString&) const. | |
bool | isGroupImmutable (const QByteArray &group) const |
Overload for isGroupImmutable(const QString&) const. | |
bool | isGroupImmutable (const QString &group) const |
Can changes be made to the entries in group ? | |
virtual bool | isImmutable () const =0 |
Checks whether this configuration object can be modified. | |
virtual void | markAsClean ()=0 |
Reset the dirty flags of all entries in the entry map, so the values will not be written to disk on a later call to sync(). | |
virtual bool | sync ()=0 |
Syncs the configuration object that this group belongs to. | |
Protected Member Functions | |
virtual void | deleteGroupImpl (const QByteArray &group, WriteConfigFlags flags=Normal)=0 |
virtual const KConfigGroup | groupImpl (const QByteArray &group) const =0 |
virtual KConfigGroup | groupImpl (const QByteArray &group)=0 |
virtual bool | hasGroupImpl (const QByteArray &group) const =0 |
virtual bool | isGroupImmutableImpl (const QByteArray &group) const =0 |
virtual void | virtual_hook (int id, void *data) |
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility. | |
Interface to interact with configuration.
KConfigBase allows a component of an application to persists its configuration without the component knowing if it is storing the configuration into a top level KConfig or a KConfigGroup inside a KConfig instance.
typedef QFlags< WriteConfigFlag > KConfigBase::WriteConfigFlags |
Stores a combination of #WriteConfigFlag values.
Possible return values for accessMode().
Flags to control write entry.
|
virtual |
Destructs the KConfigBase object.
|
pure virtual |
Returns the access mode 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).
Implemented in KConfig, and KConfigGroup.
void KConfigBase::deleteGroup | ( | const char * | group, |
WriteConfigFlags | flags = Normal |
||
) |
Overload for deleteGroup(const QString&, WriteConfigFlags)
group | name of group to delete, encoded in UTF-8 |
void KConfigBase::deleteGroup | ( | const QByteArray & | group, |
WriteConfigFlags | flags = Normal |
||
) |
Overload for deleteGroup(const QString&, WriteConfigFlags)
group | name of group to delete, encoded in UTF-8 |
void KConfigBase::deleteGroup | ( | const QString & | group, |
WriteConfigFlags | flags = Normal |
||
) |
Delete group
.
This marks group
as deleted in the config object. This effectively removes any cascaded values from config files earlier in the stack.
|
protectedpure virtual |
group | name of group, encoded in UTF-8 |
Implemented in KConfigGroup, and KConfig.
KConfigGroup KConfigBase::group | ( | const char * | group | ) |
Overload for group(const QString&)
group | name of group, encoded in UTF-8 |
const KConfigGroup KConfigBase::group | ( | const char * | group | ) | const |
Const overload for group(const QString&)
group | name of group, encoded in UTF-8 |
KConfigGroup KConfigBase::group | ( | const QByteArray & | group | ) |
Overload for group(const QString&)
group | name of group, encoded in UTF-8 |
const KConfigGroup KConfigBase::group | ( | const QByteArray & | group | ) | const |
Const overload for group(const QString&)
group | name of group, encoded in UTF-8 |
KConfigGroup KConfigBase::group | ( | const QString & | group | ) |
Returns an object for the named subgroup.
group | the group to open. Pass an empty string here to the KConfig object to obtain a handle on the root group. |
const KConfigGroup KConfigBase::group | ( | const QString & | group | ) | const |
Const overload for group(const QString&)
|
protectedpure virtual |
group | name of group, encoded in UTF-8 |
Implemented in KConfig, and KConfigGroup.
|
protectedpure virtual |
group | name of group, encoded in UTF-8 |
Implemented in KConfig, and KConfigGroup.
|
pure virtual |
Returns a list of groups that are known about.
Implemented in KConfig, and KConfigGroup.
bool KConfigBase::hasGroup | ( | const char * | group | ) | const |
Overload for hasGroup(const QString&) const.
group | name of group to search for, encoded in UTF-8 |
bool KConfigBase::hasGroup | ( | const QByteArray & | group | ) | const |
Overload for hasGroup(const QString&) const.
group | name of group to search for, encoded in UTF-8 |
bool KConfigBase::hasGroup | ( | const QString & | group | ) | const |
Returns true if the specified group is known about.
group | name of group to search for |
|
protectedpure virtual |
group | name of group, encoded in UTF-8 |
Implemented in KConfig, and KConfigGroup.
bool KConfigBase::isGroupImmutable | ( | const char * | group | ) | const |
Overload for isGroupImmutable(const QString&) const.
group | name of group, encoded in UTF-8 |
bool KConfigBase::isGroupImmutable | ( | const QByteArray & | group | ) | const |
Overload for isGroupImmutable(const QString&) const.
group | name of group, encoded in UTF-8 |
bool KConfigBase::isGroupImmutable | ( | const QString & | group | ) | const |
Can changes be made to the entries in group
?
group | The group to check for immutability. |
false
if the entries in group
can be modified, otherwise true
|
protectedpure virtual |
group | name of group, encoded in UTF-8 |
Implemented in KConfig, and KConfigGroup.
|
pure virtual |
Checks whether this configuration object can be modified.
Implemented in KConfig, and KConfigGroup.
|
pure virtual |
Reset the dirty flags of all entries in the entry map, so the values will not be written to disk on a later call to sync().
Implemented in KConfig, and KConfigGroup.
|
pure virtual |
Syncs the configuration object that this group belongs to.
Unrelated concurrent changes to the same file are merged and thus not overwritten. Note however, that this object is not automatically updated with those changes.
Implemented in KConfig, and KConfigGroup.
|
protectedvirtual |
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.
Unused in this class.
Reimplemented in KConfig.