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 }

Public Member Functions

 KConfigBase ()
virtual ~KConfigBase ()
void setGroup (const QString &group)
void setDesktopGroup ()
QString group () const
bool hasGroup (const QString &group) const
virtual QStringList groupList () const=0
QString locale () const
QString readEntry (const QString &pKey, const QString &aDefault=QString::null) const
QString readEntry (const char *pKey, const QString &aDefault=QString::null) const
QVariant readPropertyEntry (const QString &pKey, QVariant::Type) const
QVariant readPropertyEntry (const char *pKey, QVariant::Type) const
QVariant readPropertyEntry (const QString &pKey, const QVariant &aDefault) const
QVariant readPropertyEntry (const char *pKey, const QVariant &aDefault) const
int readListEntry (const QString &pKey, QStrList &list, char sep= ',') const
int readListEntry (const char *pKey, QStrList &list, char sep= ',') const
QStringList readListEntry (const QString &pKey, char sep= ',') const
QStringList readListEntry (const char *pKey, char sep= ',') const
QValueList< int > readIntListEntry (const QString &pKey) const
QValueList< int > readIntListEntry (const char *pKey) const
QString readPathEntry (const QString &pKey, const QString &aDefault=QString::null) const
QString readPathEntry (const char *pKey, const QString &aDefault=QString::null) const
QStringList readPathListEntry (const QString &pKey, char sep= ',') const
QStringList readPathListEntry (const char *pKey, char sep= ',') const
int readNumEntry (const QString &pKey, int nDefault=0) const
int readNumEntry (const char *pKey, int nDefault=0) const
unsigned int readUnsignedNumEntry (const QString &pKey, unsigned int nDefault=0) const
unsigned int readUnsignedNumEntry (const char *pKey, unsigned int nDefault=0) const
long readLongNumEntry (const QString &pKey, long nDefault=0) const
long readLongNumEntry (const char *pKey, long nDefault=0) const
unsigned long readUnsignedLongNumEntry (const QString &pKey, unsigned long nDefault=0) const
unsigned long readUnsignedLongNumEntry (const char *pKey, unsigned long nDefault=0) const
Q_INT64 readNum64Entry (const QString &pKey, Q_INT64 nDefault=0) const
Q_INT64 readNum64Entry (const char *pKey, Q_INT64 nDefault=0) const
Q_UINT64 readUnsignedNum64Entry (const QString &pKey, Q_UINT64 nDefault=0) const
Q_UINT64 readUnsignedNum64Entry (const char *pKey, Q_UINT64 nDefault=0) const
double readDoubleNumEntry (const QString &pKey, double nDefault=0.0) const
double readDoubleNumEntry (const char *pKey, double nDefault=0.0) const
QFont readFontEntry (const QString &pKey, const QFont *pDefault=0L) const
QFont readFontEntry (const char *pKey, const QFont *pDefault=0L) const
bool readBoolEntry (const QString &pKey, const bool bDefault=false) const
bool readBoolEntry (const char *pKey, const bool bDefault=false) const
QRect readRectEntry (const QString &pKey, const QRect *pDefault=0L) const
QRect readRectEntry (const char *pKey, const QRect *pDefault=0L) const
QPoint readPointEntry (const QString &pKey, const QPoint *pDefault=0L) const
QPoint readPointEntry (const char *pKey, const QPoint *pDefault=0L) const
QSize readSizeEntry (const QString &pKey, const QSize *pDefault=0L) const
QSize readSizeEntry (const char *pKey, const QSize *pDefault=0L) const
QColor readColorEntry (const QString &pKey, const QColor *pDefault=0L) const
QColor readColorEntry (const char *pKey, const QColor *pDefault=0L) const
QDateTime readDateTimeEntry (const QString &pKey, const QDateTime *pDefault=0L) const
QDateTime readDateTimeEntry (const char *pKey, const QDateTime *pDefault=0L) const
QString readEntryUntranslated (const QString &pKey, const QString &aDefault=QString::null) const
QString readEntryUntranslated (const char *pKey, const QString &aDefault=QString::null) const
void writeEntry (const QString &pKey, const QString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QVariant &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QVariant &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QStrList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QStrList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QValueList< int > &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QValueList< int > &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, unsigned int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, unsigned int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, unsigned long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, unsigned long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, Q_LLONG nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, Q_LLONG nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, Q_ULLONG nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, Q_ULLONG nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, double nValue, bool bPersistent=true, bool bGlobal=false, char format= 'g', int precision=6, bool bNLS=false)
void writeEntry (const char *pKey, double nValue, bool bPersistent=true, bool bGlobal=false, char format= 'g', int precision=6, bool bNLS=false)
void writeEntry (const QString &pKey, bool bValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, bool bValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QFont &rFont, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QFont &rFont, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QColor &rColor, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QColor &rColor, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QDateTime &rDateTime, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QDateTime &rDateTime, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QRect &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QRect &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QPoint &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QPoint &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const QString &pKey, const QSize &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const char *pKey, const QSize &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writePathEntry (const QString &pKey, const QString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writePathEntry (const char *pKey, const QString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writePathEntry (const QString &pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writePathEntry (const char *pKey, const QStringList &rValue, char sep= ',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void deleteEntry (const QString &pKey, bool bNLS=false, bool bGlobal=false)
void deleteEntry (const char *pKey, bool bNLS=false, bool bGlobal=false)
bool deleteGroup (const QString &group, bool bDeep=true, bool bGlobal=false)
void setDollarExpansion (bool _bExpand=true)
bool isDollarExpansion () const
virtual void rollback (bool bDeep=true)
virtual void sync ()
bool isDirty () const
virtual void setReadOnly (bool _ro)
bool isReadOnly () const
bool hasKey (const QString &key) const
virtual QMap< QString, QStringentryMap (const QString &group) const=0
virtual void reparseConfiguration ()=0
bool isImmutable () const
bool groupIsImmutable (const QString &group) const
bool entryIsImmutable (const QString &key) const
ConfigState getConfigState () const
bool checkConfigFilesWritable (bool warnUser)
void setReadDefaults (bool b)
bool readDefaults () const
void revertToDefault (const QString &key)
bool hasDefault (const QString &key) const
void setGroup (const QCString &pGroup)
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 ()
virtual void setDirty (bool _bDirty=true)
virtual void parseConfigFiles ()
virtual KEntryMap internalEntryMap (const QString &pGroup) const=0
virtual KEntryMap internalEntryMap () const=0
virtual void putData (const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true)=0
virtual KEntry lookupData (const KEntryKey &_key) const=0
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
QCString mGroup
QCString aLocaleString
bool bDirty
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.104 2003/11/26 23:28:41 ossi 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 1789 of file kconfigbase.h.

Referenced by getConfigState().


Constructor & Destructor Documentation

KConfigBase::KConfigBase  ) 
 

Construct a KConfigBase object.

Definition at line 50 of file kconfigbase.cpp.

References backEnd, bDirty, and setGroup().

KConfigBase::~KConfigBase  )  [virtual]
 

Destructs the KConfigBase object.

Definition at line 57 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 79 of file kconfigbase.cpp.

Referenced by KStandardDirs::addCustomized(), KConfig::checkUpdate(), KConfig::copyTo(), KNotifyClient::getDefaultFile(), KNotifyClient::getDefaultPresentation(), KNotifyClient::getFile(), KNotifyClient::getPresentation(), KIconEffect::init(), KApplication::invokeMailer(), KConfigBase(), KConfigGroupSaver::KConfigGroupSaver(), KIconTheme::KIconTheme(), KLocale::languagesTwoAlpha(), KConfigSkeleton::ItemDouble::readConfig(), 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 104 of file kconfigbase.cpp.

Referenced by KDesktopFile::copyTo(), and 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 100 of file kconfigbase.cpp.

References QString::fromUtf8().

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

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 134 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 74 of file kconfigbase.cpp.

References aLocaleString, and QString::fromUtf8().

Referenced by hasDefault(), and revertToDefault().

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 203 of file kconfigbase.cpp.

References QString::utf8().

Referenced by KStandardDirs::addCustomized(), KGlobalSettings::contextMenuKey(), KIconTheme::current(), KDesktopFile::hasApplicationType(), KDesktopFile::hasDeviceType(), KDesktopFile::hasLinkType(), KDesktopFile::hasMimeTypeType(), KIconEffect::init(), KApplication::invokeMailer(), KIconTheme::KIconTheme(), KGlobalSettings::mouseSettings(), readColorEntry(), KDesktopFile::readComment(), KDesktopFile::readDevice(), readFontEntry(), KDesktopFile::readGenericName(), KDesktopFile::readIcon(), readListEntry(), KDesktopFile::readName(), readNum64Entry(), readPathEntry(), readPropertyEntry(), KShortcutList::readSettings(), KDesktopFile::readType(), readUnsignedNum64Entry(), 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 209 of file kconfigbase.cpp.

References QString::ascii(), KEntryKey::bDefault, KEntry::bExpand, KEntryKey::bLocal, KEntryKey::c_key, QString::find(), KStringHandler::from8Bit(), QString::fromUtf8(), QString::isEmpty(), QString::isNull(), QCString::isNull(), QString::length(), lookupData(), QString::mid(), KEntry::mValue, QTextStream::read(), readDefaults(), 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.

Deprecated:
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 333 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.

Deprecated:
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 339 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 348 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 354 of file kconfigbase.cpp.

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

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

Reads a list of strings.

Deprecated:
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 433 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.

Deprecated:
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 439 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 478 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 483 of file kconfigbase.cpp.

References hasKey(), QString::isEmpty(), QString::length(), readEntry(), QString::reserve(), QString::squeeze(), KGlobal::staticQString(), 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 524 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 529 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 541 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 546 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 555 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 560 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 569 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 574 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 590 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 595 of file kconfigbase.cpp.

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

long KConfigBase::readLongNumEntry const QString