kdecore Library API Documentation

KConfigBase Class Reference

Abstract base class for KDE configuration entries. KDE Configuration Management abstract base class. More...

#include <kconfigbase.h>

Inheritance diagram for KConfigBase:

Inheritance graph
[legend]
Collaboration diagram for KConfigBase:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ConfigState { NoAccess, ReadOnly, ReadWrite }
 Possible return values for getConfigState(). More...


Public Member Functions

 KConfigBase ()
 Construct a KConfigBase object.

virtual ~KConfigBase ()
 Destructs the KConfigBase object.

void setGroup (const QString &group)
 Specifies the group in which keys will be read and written.

void setDesktopGroup ()
 Sets the group to the "Desktop Entry" group used for desktop configuration files for applications, mime types, etc.

QString group () const
 Returns the name of the group in which we are searching for keys and from which we are retrieving entries.

bool hasGroup (const QString &group) const
 Returns true if the specified group is known about.

virtual QStringList groupList () const =0
 Returns a list of groups that are known about.

QString locale () const
 Returns a the current locale.

QString readEntry (const QString &pKey, const QString &aDefault=QString::null) const
 Reads the value of an entry specified by pKey in the current group.

QString readEntry (const char *pKey, const QString &aDefault=QString::null) const
 Reads the value of an entry specified by pKey in the current group.

QVariant readPropertyEntry (const QString &pKey, QVariant::Type) const
 Reads the value of an entry specified by pKey in the current group.

QVariant readPropertyEntry (const char *pKey, QVariant::Type) const
 Reads the value of an entry specified by pKey in the current group.

QVariant readPropertyEntry (const QString &pKey, const QVariant &adefault) const
 Reads the value of an entry specified by pKey in the current group.

QVariant readPropertyEntry (const char *pKey, const QVariant &aDefault) const
 Reads the value of an entry specified by pKey in the current group.

int readListEntry (const QString &pKey, QStrList &list, char sep= ',') const
 Reads a list of strings.

int readListEntry (const char *pKey, QStrList &list, char sep= ',') const
 Reads a list of strings.

QStringList readListEntry (const QString &pKey, char sep= ',') const
 Reads a list of strings.

QStringList readListEntry (const char *pKey, char sep= ',') const
 Reads a list of strings.

QValueList< int > readIntListEntry (const QString &pKey) const
 Reads a list of Integers.

QValueList< int > readIntListEntry (const char *pKey) const
 Reads a list of Integers.

QString readPathEntry (const QString &pKey, const QString &aDefault=QString::null) const
 Reads a path.

QString readPathEntry (const char *pKey, const QString &aDefault=QString::null) const
 Reads a path.

QStringList readPathListEntry (const QString &pKey, char sep= ',') const
 Reads a list of string paths.

QStringList readPathListEntry (const char *pKey, char sep= ',') const
 Reads a list of string paths.

int readNumEntry (const QString &pKey, int nDefault=0) const
 Reads a numerical value.

int readNumEntry (const char *pKey, int nDefault=0) const
 Reads a numerical value.

unsigned int readUnsignedNumEntry (const QString &pKey, unsigned int nDefault=0) const
 Reads an unsigned numerical value.

unsigned int readUnsignedNumEntry (const char *pKey, unsigned int nDefault=0) const
 Reads an unsigned numerical value.

long readLongNumEntry (const QString &pKey, long nDefault=0) const
 Reads a numerical value.

long readLongNumEntry (const char *pKey, long nDefault=0) const
 Reads a numerical value.

unsigned long readUnsignedLongNumEntry (const QString &pKey, unsigned long nDefault=0) const
 Read an unsigned numerical value.

unsigned long readUnsignedLongNumEntry (const char *pKey, unsigned long nDefault=0) const
 Read an unsigned numerical value.

double readDoubleNumEntry (const QString &pKey, double nDefault=0.0) const
 Reads a floating point value.

double readDoubleNumEntry (const char *pKey, double nDefault=0.0) const
 Reads a floating point value.

QFont readFontEntry (const QString &pKey, const QFont *pDefault=0L) const
 Reads a QFont value.

QFont readFontEntry (const char *pKey, const QFont *pDefault=0L) const
 Reads a QFont value.

bool readBoolEntry (const QString &pKey, const bool bDefault=false) const
 Reads a boolean entry.

bool readBoolEntry (const char *pKey, const bool bDefault=false) const
 Reads a boolean entry.

QRect readRectEntry (const QString &pKey, const QRect *pDefault=0L) const
 Reads a QRect entry.

QRect readRectEntry (const char *pKey, const QRect *pDefault=0L) const
 Reads a QRect entry.

QPoint readPointEntry (const QString &pKey, const QPoint *pDefault=0L) const
 Reads a QPoint entry.

QPoint readPointEntry (const char *pKey, const QPoint *pDefault=0L) const
 Reads a QPoint entry.

QSize readSizeEntry (const QString &pKey, const QSize *pDefault=0L) const
 Reads a QSize entry.

QSize readSizeEntry (const char *pKey, const QSize *pDefault=0L) const
 Reads a QSize entry.

QColor readColorEntry (const QString &pKey, const QColor *pDefault=0L) const
 Reads a QColor entry.

QColor readColorEntry (const char *pKey, const QColor *pDefault=0L) const
 Reads a QColor entry.

QDateTime readDateTimeEntry (const QString &pKey, const QDateTime *pDefault=0L) const
 Reads a QDateTime entry.

QDateTime readDateTimeEntry (const char *pKey, const QDateTime *pDefault=0L) const
 Reads a QDateTime entry.

QString readEntryUntranslated (const QString &pKey, const QString &aDefault=QString::null) const
 Reads the value of an entry specified by pKey in the current group.

QString readEntryUntranslated (const char *pKey, const QString &aDefault=QString::null) const
 Reads the value of an entry specified by pKey in the current group.

void writeEntry (const QString &pKey, const QString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a key/value pair.

void writeEntry (const char *pKey, const QString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a key/value pair.

void writeEntry (const QString &pKey, const QVariant &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() Overridden to accept a property.

void writeEntry (const char *pKey, const QVariant &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() Overridden to accept a property.

void writeEntry (const QString &pKey, const QStrList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of strings.

void writeEntry (const char *pKey, const QStrList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of strings.

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.

void writeEntry (const char *pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of strings.

void writeEntry (const QString &pKey, const QValueList< int > &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of Integers.

void writeEntry (const char *pKey, const QValueList< int > &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of Integers.

void writeEntry (const QString &pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Write a (key/value) pair.

void writeEntry (const char *pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Write a (key/value) pair.

void writeEntry (const QString &pKey, int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Write a (key/value) pair.

void writeEntry (const char *pKey, int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Write a (key/value) pair.

void writeEntry (const QString &pKey, unsigned int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, unsigned int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, unsigned long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, unsigned long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, double nValue, bool bPersistent=true, bool bGlobal=false, char format= 'g', int precision=6, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, double nValue, bool bPersistent=true, bool bGlobal=false, char format= 'g', int precision=6, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, bool bValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, bool bValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, const QFont &rFont, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, const QFont &rFont, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, const QColor &rColor, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, const QColor &rColor, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, const QDateTime &rDateTime, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, const QDateTime &rDateTime, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, const QRect &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, const QRect &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, const QPoint &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, const QPoint &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const QString &pKey, const QSize &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writeEntry (const char *pKey, const QSize &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair.

void writePathEntry (const QString &pKey, const QString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a file path.

void writePathEntry (const char *pKey, const QString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a file path.

void writePathEntry (const QString &pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writePathEntry() overridden to accept a list of paths (strings).

void writePathEntry (const char *pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writePathEntry() overridden to accept a list of paths (strings).

void deleteEntry (const QString &pKey, bool bNLS=false, bool bGlobal=false)
 Deletes the entry specified by pKey in the current group.

void deleteEntry (const char *pKey, bool bNLS=false, bool bGlobal=false)
 Deletes the entry specified by pKey in the current group.

bool deleteGroup (const QString &group, bool bDeep=true, bool bGlobal=false)
 Deletes a configuration entry group.

void setDollarExpansion (bool _bExpand=true)
 Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries.

bool isDollarExpansion () const
 Returns whether dollar expansion is on or off.

virtual void rollback (bool bDeep=true)
 Mark the config object as "clean," i.e.

virtual void sync ()
 Flushes all changes that currently reside only in memory back to disk / permanent storage.

bool isDirty () const
 Checks whether the config file has any dirty (modified) entries.

virtual void setReadOnly (bool _ro)
 Sets the config object's read-only status.

bool isReadOnly () const
 Returns the read-only status of the config object.

bool hasKey (const QString &key) const
 Checks whether the key has an entry in the currently active group.

virtual QMap< QString, QStringentryMap (const QString &group) const =0
 Returns a map (tree) of entries for all entries in a particular group.

virtual void reparseConfiguration ()=0
 Reparses all configuration files.

bool isImmutable () const
 Checks whether this configuration file can be modified.

bool groupIsImmutable (const QString &group) const
 Checks whether it is possible to change the given group.

bool entryIsImmutable (const QString &key) const
 Checks whether it is possible to change the given entry.

ConfigState getConfigState () const
 Returns the state of the app-config object.

void setGroup (const QCString &pGroup)
 Overloaded public methods:.

void setGroup (const char *pGroup)
bool hasGroup (const QCString &_pGroup) const
bool hasGroup (const char *_pGroup) const
bool hasKey (const char *pKey) const

Protected Member Functions

void setLocale ()
 Reads the locale and put in the configuration data struct.

virtual void setDirty (bool _bDirty=true)
 Sets the global dirty flag of the config object.

virtual void parseConfigFiles ()
 Parses all configuration files for a configuration object.

virtual KEntryMap internalEntryMap (const QString &pGroup) const =0
 Returns a map (tree) of the entries in the specified group.

virtual KEntryMap internalEntryMap () const =0
 Returns a map (tree) of the entries in the tree.

virtual void putData (const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true)=0
 Inserts a (key/value) pair into the internal storage mechanism of the configuration object.

virtual KEntry lookupData (const KEntryKey &_key) const =0
 Looks up an entry in the config object's internal structure.

virtual bool internalHasGroup (const QCString &group) const =0
QCString readEntryUtf8 (const char *pKey) const
virtual void virtual_hook (int id, void *data)

Protected Attributes

KConfigBackEndbackEnd
 A back end for loading/saving to disk in a particular format.

QCString mGroup
 The currently selected group.

QCString aLocaleString
 The locale to retrieve keys under if possible, i.e en_US or fr.

bool bDirty
 Indicates whether there are any dirty entries in the config object that need to be written back to disk.

bool bLocaleInitialized
bool bReadOnly
bool bExpand

Friends

class KConfigINIBackEnd
class KConfigGroup

Detailed Description

Abstract base class for KDE configuration entries. KDE Configuration Management abstract base class.

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.

Note: the '=' char is not allowed in keys and the ']' char is not allowed in group name.

Author:
Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org>
Version:
Id
kconfigbase.h,v 1.83.2.1 2003/06/22 21:39:31 deller Exp
See also:
KGlobal::config() KConfig KSimpleConfig

Definition at line 70 of file kconfigbase.h.


Member Enumeration Documentation

enum KConfigBase::ConfigState
 

Possible return values for getConfigState().

See also:
getConfigState()

Definition at line 1661 of file kconfigbase.h.

Referenced by getConfigState(), and KConfigBackEnd::getConfigState().


Constructor & Destructor Documentation

KConfigBase::KConfigBase  ) 
 

Construct a KConfigBase object.

Definition at line 123 of file kconfigbase.cpp.

References setGroup().

KConfigBase::~KConfigBase  )  [virtual]
 

Destructs the KConfigBase object.

Definition at line 130 of file kconfigbase.cpp.


Member Function Documentation

void KConfigBase::setGroup const QString group  ) 
 

Specifies the group in which keys will be read and written.

Subsequent calls to readEntry() and writeEntry() will be aplied only in the activated group.

Switch back to the default group by passing a null string.

Parameters:
group The name of the new group.

Definition at line 151 of file kconfigbase.cpp.

References mGroup.

Referenced by KStandardDirs::addCustomized(), KConfig::checkUpdate(), KInstance::config(), KNotifyClient::getDefaultFile(), KNotifyClient::getDefaultPresentation(), KNotifyClient::getFile(), KNotifyClient::getPresentation(), KIconEffect::init(), KApplication::invokeMailer(), KConfigBase(), KConfigGroupSaver::KConfigGroupSaver(), KIconTheme::KIconTheme(), KLocale::languagesTwoAlpha(), KDesktopFile::setActionGroup(), and KLocale::twoAlphaToCountryName().

void KConfigBase::setDesktopGroup  ) 
 

Sets the group to the "Desktop Entry" group used for desktop configuration files for applications, mime types, etc.

Definition at line 176 of file kconfigbase.cpp.

References mGroup.

Referenced by KDesktopFile::KDesktopFile().

QString KConfigBase::group  )  const
 

Returns the name of the group in which we are searching for keys and from which we are retrieving entries.

Returns:
The current group.

Definition at line 172 of file kconfigbase.cpp.

References QString::fromUtf8(), and mGroup.

Referenced by KStandardDirs::addCustomized(), KConfig::checkUpdate(), and KConfig::groupList().

bool KConfigBase::hasGroup const QString group  )  const
 

Returns true if the specified group is known about.

Parameters:
group The group to search for.
Returns:
Whether the group exists.

Definition at line 205 of file kconfigbase.cpp.

Referenced by KDesktopFile::hasActionGroup(), KShortcutList::readSettings(), and KShortcutList::writeSettings().

virtual QStringList KConfigBase::groupList  )  const [pure virtual]
 

Returns a list of groups that are known about.

Returns:
The list of groups.

Implemented in KConfig.

QString KConfigBase::locale  )  const
 

Returns a the current locale.

Returns:
A string representing the current locale.

Definition at line 146 of file kconfigbase.cpp.

References aLocaleString, and QString::fromUtf8().

QString KConfigBase::readEntry const QString pKey,
const QString aDefault = QString::null
const
 

Reads the value of an entry specified by pKey in the current group.

Parameters:
pKey The key to search for.
aDefault A default value returned if the key was not found.
Returns:
The value for this key. Can be QString::null if aDefault it null.

Definition at line 274 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KGlobalSettings::contextMenuKey(), KIconTheme::current(), KDesktopFile::hasApplicationType(), KDesktopFile::hasDeviceType(), KDesktopFile::hasLinkType(), KDesktopFile::hasMimeTypeType(), KIconEffect::init(), KIconTheme::KIconTheme(), KGlobalSettings::mouseSettings(), readColorEntry(), KDesktopFile::readComment(), KDesktopFile::readDevice(), readFontEntry(), KDesktopFile::readGenericName(), KDesktopFile::readIcon(), readListEntry(), KDesktopFile::readName(), readPathEntry(), readPropertyEntry(), KShortcutList::readSettings(), KDesktopFile::readType(), KDesktopFile::tryExec(), KLocale::twoAlphaToCountryName(), and KShortcutList::writeSettings().

QString KConfigBase::readEntry const char *  pKey,
const QString aDefault = QString::null
const
 

Reads the value of an entry specified by pKey in the current group.

Parameters:
pKey The key to search for.
aDefault A default value returned if the key was not found.
Returns:
The value for this key. Can be QString::null if aDefault it null.

Definition at line 280 of file kconfigbase.cpp.

References QString::ascii(), KEntry::bExpand, KEntryKey::bLocal, KEntryKey::c_key, QFile::encodeName(), QString::find(), QString::fromLocal8Bit(), QString::fromUtf8(), QString::isEmpty(), QString::isNull(), QCString::isNull(), QString::length(), lookupData(), mGroup, QString::mid(), KEntry::mValue, QTextStream::read(), QString::remove(), QString::replace(), setLocale(), and KGlobal::staticQString().

QVariant KConfigBase::readPropertyEntry const QString pKey,
QVariant::Type 
const
 

Reads the value of an entry specified by pKey in the current group.

The value is treated as if it is of the given type.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date. This class or method is obsolete, it is provided for compatibility only.

Parameters:
pKey The key to search for.
Returns:
An invalid QVariant if the key was not found or if the read value cannot be converted to the given QVariant::Type.

Definition at line 418 of file kconfigbase.cpp.

References QString::utf8().

Referenced by readPropertyEntry().

QVariant KConfigBase::readPropertyEntry const char *  pKey,
QVariant::Type 
const
 

Reads the value of an entry specified by pKey in the current group.

The value is treated as if it is of the given type.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

This class or method is obsolete, it is provided for compatibility only.

Parameters:
pKey The key to search for.
Returns:
An invalid QVariant if the key was not found or if the read value cannot be converted to the given QVariant::Type.

Definition at line 424 of file kconfigbase.cpp.

References QVariant::cast(), hasKey(), and readPropertyEntry().

QVariant KConfigBase::readPropertyEntry const QString pKey,
const QVariant adefault
const
 

Reads the value of an entry specified by pKey in the current group.

The value is treated as if it is of the type of the given default value.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

Parameters:
pKey The key to search for.
aDefault A default value returned if the key was not found or if the read value cannot be converted to the QVariant::Type.
Returns:
The value for the key or the default value if the key was not found.

Definition at line 433 of file kconfigbase.cpp.

References readPropertyEntry(), and QString::utf8().

QVariant KConfigBase::readPropertyEntry const char *  pKey,
const QVariant aDefault
const
 

Reads the value of an entry specified by pKey in the current group.

The value is treated as if it is of the type of the given default value.

Note that only the following QVariant types are allowed : String, StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool, Double, DateTime and Date.

Parameters:
pKey The key to search for.
aDefault A default value returned if the key was not found or if the read value cannot be converted to the QVariant::Type.
Returns:
The value for the key or the default value if the key was not found.

Definition at line 439 of file kconfigbase.cpp.

References QValueList::append(), QVariant::asColor(), QVariant::asDateTime(), QVariant::asFont(), QVariant::asPoint(), QVariant::asRect(), QVariant::asSize(), QDateTime::date(), KStdAccel::end(), hasKey(), readBoolEntry(), readColorEntry(), readDateTimeEntry(), readDoubleNumEntry(), readEntry(), readFontEntry(), readListEntry(), readNumEntry(), readPointEntry(), readRectEntry(), readSizeEntry(), readUnsignedNumEntry(), QVariant::toBool(), QVariant::toDouble(), QVariant::toInt(), QVariant::toString(), QVariant::toUInt(), and QVariant::type().

int KConfigBase::readListEntry const QString pKey,
QStrList list,
char  sep = ','
const
 

Reads a list of strings.

This class or method is obsolete, it is provided for compatibility only.

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.

Definition at line 514 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KStandardDirs::addCustomized(), KConfig::checkUpdate(), KIconTheme::KIconTheme(), KLocale::languagesTwoAlpha(), KDesktopFile::readActions(), readDateTimeEntry(), readIntListEntry(), readListEntry(), readPathListEntry(), readPropertyEntry(), KDesktopFile::sortOrder(), and KDesktopFile::tryExec().

int KConfigBase::readListEntry const char *  pKey,
QStrList list,
char  sep = ','
const
 

Reads a list of strings.

This class or method is obsolete, it is provided for compatibility only.

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.

Definition at line 520 of file kconfigbase.cpp.

References hasKey(), QCString::isEmpty(), QCString::length(), and QCString::truncate().

QStringList KConfigBase::readListEntry const QString pKey,
char  sep = ','
const
 

Reads a list of strings.

Parameters:
pKey The key to search for.
sep The list separator (default is ",").
Returns:
The list. Empty if the entry does not exist.

Definition at line 558 of file kconfigbase.cpp.

References readListEntry(), and QString::utf8().

QStringList KConfigBase::readListEntry const char *  pKey,
char  sep = ','
const
 

Reads a list of strings.

Parameters:
pKey The key to search for.
sep The list separator (default is ",").
Returns:
The list. Empty if the entry does not exist.

Definition at line 563 of file kconfigbase.cpp.

References hasKey(), QString::isEmpty(), QString::length(), readEntry(), and QString::truncate().

QValueList< int > KConfigBase::readIntListEntry const QString pKey  )  const
 

Reads a list of Integers.

Parameters:
pKey The key to search for.
Returns:
The list. Empty if the entry does not exist.

Definition at line 594 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KIconTheme::KIconTheme().

QValueList< int > KConfigBase::readIntListEntry const char *  pKey  )  const
 

Reads a list of Integers.

Parameters:
pKey The key to search for.
Returns:
The list. Empty if the entry does not exist.

Definition at line 599 of file kconfigbase.cpp.

References readListEntry().

QString KConfigBase::readPathEntry const QString pKey,
const QString aDefault = QString::null
const
 

Reads 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:
pKey The key to search for.
aDefault A default value returned if the key was not found.
Returns:
The value for this key. Can be QString::null if aDefault is null.

Definition at line 611 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KCharsets::codecForName(), KNotifyClient::getDefaultFile(), KNotifyClient::getFile(), KApplication::invokeMailer(), KIconTheme::KIconTheme(), KDesktopFile::readDocPath(), KDesktopFile::readPath(), KDesktopFile::readURL(), and KDesktopFile::tryExec().

QString KConfigBase::readPathEntry const char *  pKey,
const QString aDefault = QString::null
const
 

Reads 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:
pKey The key to search for.
aDefault A default value returned if the key was not found.
Returns:
The value for this key. Can be QString::null if aDefault is null.

Definition at line 616 of file kconfigbase.cpp.

References readEntry().

QStringList KConfigBase::readPathListEntry const QString pKey,
char  sep = ','
const
 

Reads a list of string paths.

Read the value of an entry specified by pKey in the current group and interpret it as a list of paths. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

Parameters:
pKey The key to search for.
sep The list separator (default is ",").
Returns:
The list. Empty if the entry does not exist.
Since:
3.1.3

Definition at line 625 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KIconTheme::KIconTheme().

QStringList KConfigBase::readPathListEntry const char *  pKey,
char  sep = ','
const
 

Reads a list of string paths.

Read the value of an entry specified by pKey in the current group and interpret it as a list of paths. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

Parameters:
pKey The key to search for.
sep The list separator (default is ",").
Returns:
The list. Empty if the entry does not exist.
Since:
3.1.3

Definition at line 630 of file kconfigbase.cpp.

References readListEntry().

int KConfigBase::readNumEntry const QString pKey,
int  nDefault = 0
const
 

Reads a numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 639 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KGlobalSettings::autoSelectDelay(), KGlobalSettings::completionMode(), KGlobalSettings::contrast(), KGlobalSettings::dndEventDelay(), KNotifyClient::getDefaultPresentation(), KNotifyClient::getPresentation(), KGlobalSettings::insertTearOffHandle(), KIconTheme::KIconTheme(), readPropertyEntry(), and KGlobalSettings::visualActivateSpeed().

int KConfigBase::readNumEntry const char *  pKey,
int  nDefault = 0
const
 

Reads a numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 644 of file kconfigbase.cpp.

References QCString::isNull(), and QCString::toInt().

unsigned int KConfigBase::readUnsignedNumEntry const QString pKey,
unsigned int  nDefault = 0
const
 

Reads an unsigned numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 660 of file kconfigbase.cpp.

References QString::utf8().

Referenced by readPropertyEntry().

unsigned int KConfigBase::readUnsignedNumEntry const char *  pKey,
unsigned int  nDefault = 0
const
 

Reads an unsigned numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 665 of file kconfigbase.cpp.

References QCString::isNull(), and QCString::toUInt().

long KConfigBase::readLongNumEntry const QString pKey,
long  nDefault = 0
const
 

Reads a numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 679 of file kconfigbase.cpp.

References QString::utf8().

long KConfigBase::readLongNumEntry const char *  pKey,
long  nDefault = 0
const
 

Reads a numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 684 of file kconfigbase.cpp.

References QCString::isNull(), and QCString::toLong().

unsigned long KConfigBase::readUnsignedLongNumEntry const QString pKey,
unsigned long  nDefault = 0
const
 

Read an unsigned numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 698 of file kconfigbase.cpp.

References QString::utf8().

unsigned long KConfigBase::readUnsignedLongNumEntry const char *  pKey,
unsigned long  nDefault = 0
const
 

Read an unsigned numerical value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 703 of file kconfigbase.cpp.

References QCString::isNull(), and QCString::toULong().

double KConfigBase::readDoubleNumEntry const QString pKey,
double  nDefault = 0.0
const
 

Reads a floating point value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 716 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KIconEffect::init(), and readPropertyEntry().

double KConfigBase::readDoubleNumEntry const char *  pKey,
double  nDefault = 0.0
const
 

Reads a floating point value.

Read the value of an entry specified by pKey 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 or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 721 of file kconfigbase.cpp.

References QCString::isNull(), and QCString::toDouble().

QFont KConfigBase::readFontEntry const QString pKey,
const QFont pDefault = 0L
const
 

Reads a QFont value.

Read the value of an entry specified by pKey in the current group and interpret it as a font object.

Parameters:
pKey The key to search for.
pDefault A default value (null QFont by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 762 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KGlobalSettings::fixedFont(), KGlobalSettings::generalFont(), KGlobalSettings::menuFont(), readPropertyEntry(), KGlobalSettings::taskbarFont(), KGlobalSettings::toolBarFont(), and KGlobalSettings::windowTitleFont().

QFont KConfigBase::readFontEntry const char *  pKey,
const QFont pDefault = 0L
const
 

Reads a QFont value.

Read the value of an entry specified by pKey in the current group and interpret it as a font object.

Parameters:
pKey The key to search for.
pDefault A default value (null QFont by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 767 of file kconfigbase.cpp.

References QString::contains(), QString::find(), QFont::fromString(), QString::isNull(), QString::left(), QString::length(), QString::mid(), readEntry(), QString::right(), QFont::setFamily(), QFont::setFixedPitch(), QFont::setItalic(), QFont::setPointSize(), QFont::setRawMode(), QFont::setStrikeOut(), QFont::setStyleHint(), QFont::setUnderline(), and QFont::setWeight().

bool KConfigBase::readBoolEntry const QString pKey,
const bool  bDefault = false
const
 

Reads 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.

Definition at line 735 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KStandardDirs::addCustomized(), KApplication::authorize(), KGlobalSettings::changeCursorOverIcon(), KInstance::config(), KIconEffect::init(), KNotifyClient::Instance::Instance(), KApplication::invokeMailer(), KIconTheme::KIconTheme(), readPropertyEntry(), KGlobalSettings::showContextMenusOnPress(), KGlobalSettings::singleClick(), KDesktopFile::tryExec(), and KGlobalSettings::visualActivate().

bool KConfigBase::readBoolEntry const char *  pKey,
const bool  bDefault = false
const
 

Reads 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.

Definition at line 740 of file kconfigbase.cpp.

References QCString::isNull(), and QCString::toInt().

QRect KConfigBase::readRectEntry const QString pKey,
const QRect pDefault = 0L
const
 

Reads a QRect 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 (null QRect by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 859 of file kconfigbase.cpp.

References QString::utf8().

Referenced by readPropertyEntry().

QRect KConfigBase::readRectEntry const char *  pKey,
const QRect pDefault = 0L
const
 

Reads a QRect 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 (null QRect by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 864 of file kconfigbase.cpp.

References QCString::isEmpty().

QPoint KConfigBase::readPointEntry const QString pKey,
const QPoint pDefault = 0L
const
 

Reads a QPoint 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 (null QPoint by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 883 of file kconfigbase.cpp.

References QString::utf8().

Referenced by readPropertyEntry().

QPoint KConfigBase::readPointEntry const char *  pKey,
const QPoint pDefault = 0L
const
 

Reads a QPoint 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 (null QPoint by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 889 of file kconfigbase.cpp.

References QCString::isEmpty().

QSize KConfigBase::readSizeEntry const QString pKey,
const QSize pDefault = 0L
const
 

Reads a QSize 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 (null QSize by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 908 of file kconfigbase.cpp.

References QString::utf8().

Referenced by readPropertyEntry().

QSize KConfigBase::readSizeEntry const char *  pKey,
const QSize pDefault = 0L
const
 

Reads a QSize 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 (null QSize by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 914 of file kconfigbase.cpp.

References QCString::isEmpty().

QColor KConfigBase::readColorEntry const QString pKey,
const QColor pDefault = 0L
const
 

Reads a QColor entry.

Read the value of an entry specified by pKey in the current group and interpret it as a color.

Parameters:
pKey The key to search for.
pDefault A default value (null QColor by default) returned if the key was not found or if the value cannot be interpreted.
Returns:
The value for this key.

Definition at line 934 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KGlobalSettings::activeTextColor(), KGlobalSettings::activeTitleColor(), KGlobalSettings::alternateBackgroundColor(), KGlobalSettings::baseColor(), KGlobalSettings::highlightColor(), KGlobalSettings::highlightedTextColor(), KGlobalSettings::inactiveTextColor(), KGlobalSettings::inactiveTitleColor(), KIconEffect::init(), KGlobalSettings::linkColor(), readPropertyEntry(), KGlobalSettings::textColor(), KGlobalSettings::toolBarHighlightColor(), and KGlobalSettings::visitedLinkColor().

QColor KConfigBase::readColorEntry const char *  pKey,
const QColor pDefault = 0L
const
 

Reads a QColor entry.

Read the value of an entry specified by pKey in the current group and interpret it as a color.

Parameters:
pKey The key to search for.
pDefault A default value (null QColor by default) returned if the key was not found or if the value cannot be interpreted.
Returns:
The value for this key.

Definition at line 940 of file kconfigbase.cpp.

References QString::at(), QString::find(), QString::isEmpty(), QString::left(), QString::length(), QString::mid(), readEntry(), QString::right(), QColor::setNamedColor(), and QColor::setRgb().

QDateTime KConfigBase::readDateTimeEntry const QString pKey,
const QDateTime pDefault = 0L
const
 

Reads a QDateTime entry.

Read the value of an entry specified by pKey in the current group and interpret it as a date and time.

Parameters:
pKey The key to search for.
pDefault A default value (currentDateTime() by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 999 of file kconfigbase.cpp.

References QString::utf8().

Referenced by readPropertyEntry().

QDateTime KConfigBase::readDateTimeEntry const char *  pKey,
const QDateTime pDefault = 0L
const
 

Reads a QDateTime entry.

Read the value of an entry specified by pKey in the current group and interpret it as a date and time.

Parameters:
pKey The key to search for.
pDefault A default value (currentDateTime() by default) returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

Definition at line 1006 of file kconfigbase.cpp.

References QDateTime::currentDateTime(), hasKey(), and readListEntry().

QString KConfigBase::readEntryUntranslated const QString pKey,
const QString aDefault = QString::null
const
 

Reads the value of an entry specified by pKey in the current group.

The untranslated entry is returned, you normally do not need this.

Parameters:
pKey The key to search for.
aDefault A default value returned if the key was not found.
Returns:
The value for this key.

Definition at line 257 of file kconfigbase.cpp.

References QString::utf8().

QString KConfigBase::readEntryUntranslated const char *  pKey,
const QString aDefault = QString::null
const
 

Reads the value of an entry specified by pKey in the current group.

The untranslated entry is returned, you normally do not need this.

Parameters:
pKey The key to search for.
aDefault A default value returned if the key was not found.
Returns:
The value for this key.

Definition at line 264 of file kconfigbase.cpp.

References QString::fromUtf8(), and QCString::isNull().

void KConfigBase::writeEntry const QString pKey,
const QString pValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a key/value pair.

This is stored in 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1031 of file kconfigbase.cpp.

References QString::utf8().

Referenced by writeEntry(), writePathEntry(), and KShortcutList::writeSettings().

void KConfigBase::writeEntry const char *  pKey,
const QString pValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a key/value pair.

This is stored in 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1039 of file kconfigbase.cpp.

References KEntry::bDirty, KEntry::bGlobal, KEntryKey::bLocal, KEntry::bNLS, KGlobal::locale(), mGroup, KEntry::mValue, putData(), setDirty(), setLocale(), and QString::utf8().

void KConfigBase::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:
pKey The key to write
rValue The property 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1224 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  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:
pKey The key to write
rValue The property 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1231 of file kconfigbase.cpp.

References QValueList::begin(), QValueList::end(), KStdAccel::end(), QVariant::toBool(), QVariant::toColor(), QVariant::toDate(), QVariant::toDateTime(), QVariant::toDouble(), QVariant::toFont(), QVariant::toInt(), QVariant::toList(), QVariant::toPoint(), QVariant::toRect(), QVariant::toSize(), QVariant::toString(), QVariant::toStringList(), QVariant::toUInt(), QVariant::type(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
const QStrList 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:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1317 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QStrList 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:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1324 of file kconfigbase.cpp.

References QString::at(), QString::fromLatin1(), QString::fromLocal8Bit(), QString::fromUtf8(), QString::length(), QString::truncate(), and writeEntry().

void KConfigBase::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:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1359 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  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:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1366 of file kconfigbase.cpp.

References QString::at(), QString::fromLatin1(), QString::length(), QString::truncate(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
const QValueList< int > &  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:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1394 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QValueList< int > &  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:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

Definition at line 1400 of file kconfigbase.cpp.

References QValueList::begin(), QValueList::end(), KStdAccel::end(), QString::number(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
const char *  pValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
[inline]
 

Write a (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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 907 of file kconfigbase.h.

References QString::fromLatin1(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const char *  pValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
[inline]
 

Write a (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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 928 of file kconfigbase.h.

References QString::fromLatin1(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
int  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Write a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1410 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
int  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Write a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1417 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
unsigned int  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1425 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
unsigned int  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1432 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
long  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1440 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
long  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1447 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
unsigned long  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1455 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
unsigned long  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1462 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
double  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
char  format = 'g',
int  precision = 6,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
format format determines the format to which the value is converted. Default is 'g'.
precision precision sets the precision with which the value is converted. Default is 6 as in QString.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1470 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
double  nValue,
bool  bPersistent = true,
bool  bGlobal = false,
char  format = 'g',
int  precision = 6,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
format format determines the format to which the value is converted. Default is 'g'.
precision precision sets the precision with which the value is converted. Default is 6 as in QString.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1479 of file kconfigbase.cpp.

References QString::number(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
bool  bValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1489 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
bool  bValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1497 of file kconfigbase.cpp.

References writeEntry().

void KConfigBase::writeEntry const QString pKey,
const QFont rFont,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a font value.

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1513 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QFont rFont,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a font value.

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1520 of file kconfigbase.cpp.

References QFont::toString(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
const QColor rColor,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but write a color entry.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1589 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QColor rColor,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but write a color entry.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1597 of file kconfigbase.cpp.

References QColor::blue(), QColor::green(), QColor::isValid(), QColor::red(), QString::sprintf(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
const QDateTime rDateTime,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a date and time entry.

Note: Unlike the other writeEntry() functions, the old value is not returned here!

Parameters:
pKey The key to write.
rValue The date and time 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1611 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QDateTime rDateTime,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a date and time entry.

Note: Unlike the other writeEntry() functions, the old value is not returned here!

Parameters:
pKey The key to write.
rValue The date and time 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1618 of file kconfigbase.cpp.

References QDateTime::date(), QDate::day(), QTime::hour(), QTime::minute(), QDate::month(), QTime::second(), QCString::setNum(), QDateTime::time(), writeEntry(), and QDate::year().

void KConfigBase::writeEntry const QString pKey,
const QRect rValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a rectangle.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1528 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QRect rValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a rectangle.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1535 of file kconfigbase.cpp.

References QRect::height(), QRect::left(), QCString::setNum(), QRect::top(), QRect::width(), and writeEntry().

void KConfigBase::writeEntry const QString pKey,
const QPoint rValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a point.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1550 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QPoint rValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a point.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1557 of file kconfigbase.cpp.

References QCString::setNum(), writeEntry(), QPoint::x(), and QPoint::y().

void KConfigBase::writeEntry const QString pKey,
const QSize rValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a size.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1570 of file kconfigbase.cpp.

References QString::utf8(), and writeEntry().

void KConfigBase::writeEntry const char *  pKey,
const QSize rValue,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a size.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1577 of file kconfigbase.cpp.

References QSize::height(), QCString::setNum(), QSize::width(), and writeEntry().

void KConfigBase::writePathEntry const QString pKey,
const QString path,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a file path.

It is checked whether the path is located under $HOME. If so the path is written out with the user's home-directory replaced with $HOME. The path should be read back with readPathEntry()

Parameters:
pKey The key to write.
path The path 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1070 of file kconfigbase.cpp.

References QString::utf8().

Referenced by writePathEntry().

void KConfigBase::writePathEntry const char *  pKey,
const QString path,
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

Writes a file path.

It is checked whether the path is located under $HOME. If so the path is written out with the user's home-directory replaced with $HOME. The path should be read back with readPathEntry()

Parameters:
pKey The key to write.
path The path 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.

Definition at line 1127 of file kconfigbase.cpp.

References writeEntry().

void KConfigBase::writePathEntry const QString pKey,
const QStringList rValue,
char  sep = ',',
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

writePathEntry() overridden to accept a list of paths (strings).

It is checked whether the paths are located under $HOME. If so each of the paths are written out with the user's home-directory replaced with $HOME. The paths should be read back with readPathListEntry()

Parameters:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writePathEntry()

readPathListEntry()

Since:
3.1.3

Definition at line 1134 of file kconfigbase.cpp.

References QString::utf8(), and writePathEntry().

void KConfigBase::writePathEntry const char *  pKey,
const QStringList rValue,
char  sep = ',',
bool  bPersistent = true,
bool  bGlobal = false,
bool  bNLS = false
 

writePathEntry() overridden to accept a list of paths (strings).

It is checked whether the paths are located under $HOME. If so each of the paths are written out with the user's home-directory replaced with $HOME. The paths should be read back with readPathListEntry()

Parameters:
pKey The key to write
rValue The list 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 KDE config file.
bNLS If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writePathEntry()

readPathListEntry()

Since:
3.1.3

Definition at line 1141 of file kconfigbase.cpp.

References QString::fromLatin1(), and writeEntry().

void KConfigBase::deleteEntry const QString pKey,
bool  bNLS = false,
bool  bGlobal = false
 

Deletes the entry specified by pKey in the current group.

Parameters:
pKey The key to delete.
bGlobal If bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
bNLS If bNLS is true, the key with the locale tag is removed.

Definition at line 1160 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KShortcutList::writeSettings().

void KConfigBase::deleteEntry const char *  pKey,
bool  bNLS = false,
bool  bGlobal = false
 

Deletes the entry specified by pKey in the current group.

Parameters:
pKey The key to delete.
bGlobal If bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
bNLS If bNLS is true, the key with the locale tag is removed.

Definition at line 1167 of file kconfigbase.cpp.

References KEntry::bDeleted, KEntry::bDirty, KEntry::bGlobal, KEntry::bNLS, KGlobal::locale(), mGroup, putData(), setDirty(), and setLocale().

bool KConfigBase::deleteGroup const QString group,
bool  bDeep = true,
bool  bGlobal = false
 

Deletes a configuration entry group.

If the group is not empty and bDeep is false, nothing gets deleted and false is returned. If this group is the current group and it is deleted, the current group is undefined and should be set with setGroup() before the next operation on the configuration object.

Parameters:
group The name of the group
bDeep Specify whether non-empty groups should be completely deleted (including their entries).
bGlobal If bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
Returns:
If the group is not empty and bDeep is false, deleteGroup returns false.

Definition at line 1193 of file kconfigbase.cpp.

References QMap::begin(), QMap::end(), internalEntryMap(), QMap::isEmpty(), putData(), and setDirty().

Referenced by KShortcutList::writeSettings().

void KConfigBase::setDollarExpansion bool  _bExpand = true  )  [inline]
 

Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries.

Dollar sign expansion is initially OFF.

Parameters:
_bExpand Tf true, dollar expansion is turned on.

Definition at line 1535 of file kconfigbase.h.

bool KConfigBase::isDollarExpansion  )  const [inline]
 

Returns whether dollar expansion is on or off.

It is initially OFF.

Returns:
true if dollar expansion is on.

Definition at line 1542 of file kconfigbase.h.

void KConfigBase::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 KConfigBase should override this method and implement storage-specific behavior, as well as calling the KConfigBase::rollback() explicitly in the initializer.

Parameters:
bDeep If true, the dirty flags of all entries are cleared, as well as the global dirty flag.

Reimplemented in KConfig.

Definition at line 1668 of file kconfigbase.cpp.

References bDirty.

Referenced by KConfig::rollback(), and sync().

void KConfigBase::sync  )  [virtual]
 

Flushes 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()

Reimplemented in KSimpleConfig.

Definition at line 1651 of file kconfigbase.cpp.

References backEnd, bDirty, isReadOnly(), rollback(), and KConfigBackEnd::sync().

Referenced by KShortcutList::writeSettings(), and KConfig::~KConfig().

bool KConfigBase::isDirty  )  const [inline]
 

Checks whether the config file has any dirty (modified) entries.

Returns:
true if the config file has any dirty (modified) entries.

Definition at line 1579 of file kconfigbase.h.

References bDirty.

Referenced by KSimpleConfig::sync(), and KConfigINIBackEnd::sync().

virtual void KConfigBase::setReadOnly bool  _ro  )  [inline, virtual]
 

Sets the config object's read-only status.

Parameters:
_ro If true, the config object will not write out any changes to disk even if it is destroyed or sync() is called.

Definition at line 1588 of file kconfigbase.h.

Referenced by KConfig::KConfig(), KDesktopFile::KDesktopFile(), and KSimpleConfig::KSimpleConfig().

bool KConfigBase::isReadOnly  )  const [inline]
 

Returns the read-only status of the config object.

Returns:
The read-only status.

Definition at line 1595 of file kconfigbase.h.

Referenced by KConfigINIBackEnd::parseConfigFiles(), KSimpleConfig::sync(), sync(), and KConfigINIBackEnd::writeConfigFile().

bool KConfigBase::hasKey const QString key  )  const
 

Checks 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:
pKey The key to search for.
Returns:
If true, the key is available.

Definition at line 181 of file kconfigbase.cpp.

References KStdAccel::key().

Referenced by KLocale::languagesTwoAlpha(), readDateTimeEntry(), readListEntry(), and readPropertyEntry().

virtual QMap<QString, QString> KConfigBase::entryMap const QString group  )  const [pure virtual]
 

Returns 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:
group A group to get keys from.
Returns:
A map of entries in the group specified, indexed by key. The returned map may be empty if the group is not found.
See also:
QMap

Implemented in KConfig.

virtual void KConfigBase::reparseConfiguration  )  [pure virtual]
 

Reparses all configuration files.

This is useful for programs that use stand alone 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.

See also:
parseConfigFiles()

Implemented in KConfig.

bool KConfigBase::isImmutable  )  const
 

Checks whether this configuration file can be modified.

Returns:
whether changes may be made to this configuration file.

Definition at line 220 of file kconfigbase.cpp.

References getConfigState().

bool KConfigBase::groupIsImmutable const QString group  )  const
 

Checks whether it is possible to change the given group.

Parameters:
group the group to check
Returns:
whether changes may be made to group in this configuration file.

Definition at line 225 of file kconfigbase.cpp.

References KEntry::bImmutable, getConfigState(), and lookupData().

bool KConfigBase::entryIsImmutable const QString key  )  const
 

Checks whether it is possible to change the given entry.

Parameters:
the key to check
Returns:
whether the entry key may be changed in the current group in this configuration file.

Definition at line 235 of file kconfigbase.cpp.

References KEntry::bImmutable, KEntryKey::bLocal, KEntryKey::c_key, getConfigState(), KStdAccel::key(), lookupData(), and mGroup.

KConfigBase::ConfigState KConfigBase::getConfigState  )  const
 

Returns 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).

See also:
ConfigState()
Returns:
the state of the app-config object

Definition at line 1662 of file kconfigbase.cpp.

References backEnd, ConfigState, and KConfigBackEnd::getConfigState().

Referenced by entryIsImmutable(), groupIsImmutable(), and isImmutable().

void KConfigBase::setLocale  )  [protected]
 

Reads 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()

Definition at line 134 of file kconfigbase.cpp.

References aLocaleString, backEnd, KLocale::defaultLanguage(), KLocale::language(), KGlobal::locale(), KConfigBackEnd::setLocaleString(), and QString::utf8().

Referenced by deleteEntry(), parseConfigFiles(), readEntry(), and writeEntry().

virtual void KConfigBase::setDirty bool  _bDirty = true  )  [inline, protected, virtual]
 

Sets the global dirty flag of the config object.

Parameters:
_bDirty How to mark the object's dirty status

Definition at line 1691 of file kconfigbase.h.

References bDirty.

Referenced by deleteEntry(), deleteGroup(), and writeEntry().

void KConfigBase::parseConfigFiles  )  [protected, virtual]
 

Parses all configuration files for a configuration object.

The actual parsing is done by the associated KConfigBackEnd.

Definition at line 1639 of file kconfigbase.cpp.

References backEnd, KConfigBackEnd::getConfigState(), KConfigBackEnd::parseConfigFiles(), and setLocale().

Referenced by KConfig::reparseConfiguration().

virtual KEntryMap KConfigBase::internalEntryMap const QString pGroup  )  const [protected, pure virtual]
 

Returns a 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:
pGroup The group to provide a KEntryMap for.
Returns:
The map of the entries in the group.

Implemented in KConfig.

Referenced by KConfigINIBackEnd::writeConfigFile().

virtual KEntryMap KConfigBase::internalEntryMap  )  const [protected, pure virtual]
 

Returns a 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.

Implemented in KConfig.

Referenced by deleteGroup().

virtual void KConfigBase::putData const KEntryKey _key,
const KEntry _data,
bool  _checkGroup = true
[protected, pure virtual]
 

Inserts 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:
_key The key to insert. It contains information both on the group of the key and the key itself. If the key already exists, the old value will be replaced.
_data the KEntry that is to be stored.
_checkGroup When false, assume that the group already exists.

Implemented in KConfig.

Referenced by deleteEntry(), deleteGroup(), KConfigINIBackEnd::parseSingleConfigFile(), and writeEntry().

virtual KEntry KConfigBase::lookupData const KEntryKey _key  )  const [protected, pure virtual]
 

Looks 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:
_key The key to look up It contains information both on the group of the key and the entry's key itself.
Returns:
The KEntry value (data) found for the key. KEntry.aValue will be the null string if nothing was located.

Implemented in KConfig.

Referenced by entryIsImmutable(), groupIsImmutable(), KConfigINIBackEnd::parseSingleConfigFile(), and readEntry().

void KConfigBase::setGroup const QCString pGroup  ) 
 

Overloaded public methods:.

Definition at line 164 of file kconfigbase.cpp.

References mGroup.


Member Data Documentation

KConfigBackEnd* KConfigBase::backEnd [protected]
 

A back end for loading/saving to disk in a particular format.

Definition at line 1768 of file kconfigbase.h.

Referenced by KDesktopFile::fileName(), getConfigState(), KConfig::KConfig(), KDesktopFile::KDesktopFile(), KSimpleConfig::KSimpleConfig(), parseConfigFiles(), KDesktopFile::resource(), KConfig::setFileWriteMode(), setLocale(), KSimpleConfig::sync(), sync(), and KConfig::~KConfig().

QCString KConfigBase::mGroup [protected]
 

The currently selected group.

Definition at line 1784 of file kconfigbase.h.

Referenced by deleteEntry(), entryIsImmutable(), group(), readEntry(), setDesktopGroup(), setGroup(), and writeEntry().

QCString KConfigBase::aLocaleString [protected]
 

The locale to retrieve keys under if possible, i.e en_US or fr.

Definition at line 1788 of file kconfigbase.h.

Referenced by locale(), and setLocale().

bool KConfigBase::bDirty [protected]
 

Indicates whether there are any dirty entries in the config object that need to be written back to disk.

Definition at line 1793 of file kconfigbase.h.

Referenced by isDirty(), rollback(), setDirty(), and sync().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:48:09 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001