KDECore
KConfig Class Reference
#include <kconfig.h>

Detailed Description
Definition at line 41 of file kconfig.h.
Public Types | |
| enum | OpenFlag { IncludeGlobals = 0x01, CascadeConfig = 0x02, SimpleConfig = 0x00, NoCascade = IncludeGlobals, NoGlobals = CascadeConfig, FullConfig = IncludeGlobals|CascadeConfig } |
Public Member Functions | |
| KConfig (const QString &file=QString(), OpenFlags mode=FullConfig, const char *resourceType="config") | |
| KConfig (const KComponentData &componentData, const QString &file=QString(), OpenFlags mode=FullConfig, const char *resourceType="config") | |
| virtual | ~KConfig () |
| const KComponentData & | componentData () const |
| QString | name () const |
| void | sync () |
| void | markAsClean () |
| KConfig * | copyTo (const QString &file, KConfig *config=0) const |
| void | checkUpdate (const QString &id, const QString &updateFile) |
| void | reparseConfiguration () |
| QStringList | groupList () const |
| QMap< QString, QString > | entryMap (const QString &aGroup=QString()) const |
| AccessMode | accessMode () const |
| bool | isConfigWritable (bool warnUser) |
| void | addConfigSources (const QStringList &sources) |
| QString | locale () const |
| bool | setLocale (const QString &aLocale) |
| void | setReadDefaults (bool b) |
| bool | readDefaults () const |
| bool | isImmutable () const |
| void | setForceGlobal (bool force) |
| bool | forceGlobal () const |
Protected Member Functions | |
| virtual bool | hasGroupImpl (const QByteArray &group) const |
| virtual KConfigGroup | groupImpl (const QByteArray &b) |
| virtual const KConfigGroup | groupImpl (const QByteArray &b) const |
| virtual void | deleteGroupImpl (const QByteArray &group, WriteConfigFlags flags=Normal) |
| virtual bool | isGroupImmutableImpl (const QByteArray &aGroup) const |
| virtual void | virtual_hook (int id, void *data) |
| KConfig (KConfigPrivate &d) | |
Protected Attributes | |
| KConfigPrivate *const | d_ptr |
Friends | |
| class | KConfigGroup |
| class | KConfigGroupPrivate |
Member Enumeration Documentation
| enum KConfig::OpenFlag |
- Enumerator:
Constructor & Destructor Documentation
| KConfig::KConfig | ( | const QString & | file = QString(), |
|
| OpenFlags | mode = FullConfig, |
|||
| const char * | resourceType = "config" | |||
| ) | [explicit] |
Definition at line 116 of file kconfig.cpp.
| KConfig::KConfig | ( | const KComponentData & | componentData, | |
| const QString & | file = QString(), |
|||
| OpenFlags | mode = FullConfig, |
|||
| const char * | resourceType = "config" | |||
| ) | [explicit] |
Definition at line 126 of file kconfig.cpp.
| KConfig::~KConfig | ( | ) | [virtual] |
Definition at line 141 of file kconfig.cpp.
| KConfig::KConfig | ( | KConfigPrivate & | d | ) | [protected] |
Definition at line 136 of file kconfig.cpp.
Member Function Documentation
| const KComponentData & KConfig::componentData | ( | ) | const |
Definition at line 149 of file kconfig.cpp.
| QString KConfig::name | ( | ) | const |
| void KConfig::sync | ( | ) | [virtual] |
| void KConfig::markAsClean | ( | ) | [virtual] |
| KConfig::AccessMode KConfig::accessMode | ( | ) | const [virtual] |
configuration object state
- Reimplemented from superclass.
Implements KConfigBase.
Definition at line 449 of file kconfig.cpp.
Definition at line 583 of file kconfig.cpp.
Copies all entries from this config object to a new config object that will save itself to file.
Actual saving to file happens when the returned object is destructed or when sync() is called upon it.
- Parameters:
-
file the new config object will save itself to. config optional config object to reuse
Definition at line 292 of file kconfig.cpp.
Checks whether the config file contains the update id as contained in updateFile.
If not, it runs kconf_update to update the config file.
If you install config update files with critical fixes you may wish to use this method to verify that a critical update has indeed been performed to catch the case where a user restores an old config file from backup that has not been updated yet.
- Parameters:
-
id the update to check updateFile the file containing the update
Definition at line 281 of file kconfig.cpp.
| void KConfig::reparseConfiguration | ( | ) |
Clears all internal data structures and then reread configuration information from persistent storage.
Definition at line 359 of file kconfig.cpp.
| void KConfig::addConfigSources | ( | const QStringList & | sources | ) |
extra config files
Sets the merge stack to the list of files. The stack is last in first out with the top of the stack being the most specific config file.
- Note:
- : Most specific config file is relative to this list, the overall most specific file of this KConfig object is still the file it was created with, no matter which file is passed last into this function. This includes that writing always goes to the file which was used to create the KConfig object.
- Parameters:
-
files A list of extra config files containing the full paths of the local config files to set.
Definition at line 461 of file kconfig.cpp.
| QString KConfig::locale | ( | ) | const |
Sets the locale to aLocale.
The global locale is used as default.
- Note:
- If set to the empty string, no locale will be matched. This effectively disables Native Language Support.
- Returns:
trueif locale was changed and configuration was reparsed.
Definition at line 483 of file kconfig.cpp.
| void KConfig::setReadDefaults | ( | bool | b | ) |
defaults
When set, all readEntry and readXXXEntry calls return the system wide (default) values instead of the user's preference. This is off by default.
Definition at line 493 of file kconfig.cpp.
| bool KConfig::readDefaults | ( | ) | const |
Definition at line 499 of file kconfig.cpp.
| bool KConfig::isImmutable | ( | ) | const [virtual] |
immutability
- Reimplemented from superclass.
Implements KConfigBase.
Definition at line 505 of file kconfig.cpp.
| void KConfig::setForceGlobal | ( | bool | force | ) |
global
Forces all following write-operations to be performed on kdeglobals, independent of the Global flag in writeEntry().
- Parameters:
-
force true to force writing to kdeglobals
- See also:
- forceGlobal
Definition at line 517 of file kconfig.cpp.
| bool KConfig::forceGlobal | ( | ) | const |
Returns whether all entries are being written to kdeglobals.
- Returns:
trueif all entries are being written tokdeglobals
- See also:
- setForceGlobal
Definition at line 523 of file kconfig.cpp.
| QStringList KConfig::groupList | ( | ) | const [virtual] |
Returns a map (tree) of entries in a particular group.
Only the actual entry as a string is returned, none of the other internal data is included.
- Parameters:
-
aGroup The group to get keys from - If
aGroupis the empty string "", the entries from the default group are returned. - If
aGroupis null, the entries from the current group are returned.
- If
- Returns:
- A map of entries in the group specified, indexed by key. The returned map may be empty if the group is empty, or not found.
- See also:
- QMap
Definition at line 206 of file kconfig.cpp.
| bool KConfig::hasGroupImpl | ( | const QByteArray & | group | ) | const [protected, virtual] |
| KConfigGroup KConfig::groupImpl | ( | const QByteArray & | b | ) | [protected, virtual] |
| const KConfigGroup KConfig::groupImpl | ( | const QByteArray & | b | ) | const [protected, virtual] |
| void KConfig::deleteGroupImpl | ( | const QByteArray & | group, | |
| WriteConfigFlags | flags = Normal | |||
| ) | [protected, virtual] |
| bool KConfig::isGroupImmutableImpl | ( | const QByteArray & | aGroup | ) | const [protected, virtual] |
| void KConfig::virtual_hook | ( | int | id, | |
| void * | data | |||
| ) | [protected, virtual] |
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.
Unused in this class.
Reimplemented from KConfigBase.
Definition at line 666 of file kconfig.cpp.
Friends And Related Function Documentation
friend class KConfigGroup [friend] |
Member Data Documentation
KConfigPrivate* const KConfig::d_ptr [protected] |
The documentation for this class was generated from the following files:
KDE 4.0 API Reference