KDECore
kcoreconfigskeleton.cpp
Go to the documentation of this file.
976static int kCoreConfigSkeletionDebugArea() { static int s_area = KDebug::registerArea("kdecore (KConfigSkeleton)"); return s_area; }
982 //kDebug(kCoreConfigSkeletionDebugArea()) << "Creating KCoreConfigSkeleton (" << (void *)this << ")";
998 //kDebug(kCoreConfigSkeletionDebugArea()) << "Creating KCoreConfigSkeleton (" << (void *)this << ")";
1117KCoreConfigSkeleton::ItemString *KCoreConfigSkeleton::addItemString( const QString &name, QString &reference,
1128KCoreConfigSkeleton::ItemPassword *KCoreConfigSkeleton::addItemPassword( const QString &name, QString &reference,
1138KCoreConfigSkeleton::ItemPath *KCoreConfigSkeleton::addItemPath( const QString &name, QString &reference,
1148KCoreConfigSkeleton::ItemProperty *KCoreConfigSkeleton::addItemProperty( const QString &name, QVariant &reference,
1158KCoreConfigSkeleton::ItemBool *KCoreConfigSkeleton::addItemBool( const QString &name, bool &reference,
1168KCoreConfigSkeleton::ItemInt *KCoreConfigSkeleton::addItemInt( const QString &name, qint32 &reference,
1178KCoreConfigSkeleton::ItemUInt *KCoreConfigSkeleton::addItemUInt( const QString &name, quint32 &reference,
1188KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemLongLong( const QString &name, qint64 &reference,
1209KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemULongLong( const QString &name, quint64 &reference,
1230KCoreConfigSkeleton::ItemDouble *KCoreConfigSkeleton::addItemDouble( const QString &name, double &reference,
1240KCoreConfigSkeleton::ItemRect *KCoreConfigSkeleton::addItemRect( const QString &name, QRect &reference,
1250KCoreConfigSkeleton::ItemPoint *KCoreConfigSkeleton::addItemPoint( const QString &name, QPoint &reference,
1260KCoreConfigSkeleton::ItemSize *KCoreConfigSkeleton::addItemSize( const QString &name, QSize &reference,
1270KCoreConfigSkeleton::ItemDateTime *KCoreConfigSkeleton::addItemDateTime( const QString &name, QDateTime &reference,
1280KCoreConfigSkeleton::ItemStringList *KCoreConfigSkeleton::addItemStringList( const QString &name, QStringList &reference,
1290KCoreConfigSkeleton::ItemIntList *KCoreConfigSkeleton::addItemIntList( const QString &name, QList<int> &reference,
T readEntry(const QString &key, const T &aDefault) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfiggroup.h:248
bool hasDefault(const QString &key) const
Whether a default is specified for an entry in either the system wide configuration file or the globa...
Definition: kconfiggroup.cpp:1139
bool hasKey(const QString &key) const
Checks whether the key has an entry in this group.
Definition: kconfiggroup.cpp:1155
QString readPathEntry(const QString &pKey, const QString &aDefault) const
Reads a path.
Definition: kconfiggroup.cpp:780
void writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags=Normal)
Writes a file path to the configuration.
Definition: kconfiggroup.cpp:1074
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
Writes a value to the configuration object.
Definition: kconfiggroup.cpp:1037
void revertToDefault(const QString &key)
Reverts an entry to the default settings.
Definition: kconfiggroup.cpp:1125
KConfigSkeletonItem(const QString &_group, const QString &_key)
Constructor.
Definition: kcoreconfigskeleton.cpp:30
virtual QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kcoreconfigskeleton.cpp:103
void readImmutability(const KConfigGroup &group)
sets mIsImmutable to true if mKey in config is immutable
Definition: kcoreconfigskeleton.cpp:118
void setToolTip(const QString &t)
Set ToolTip description of item.
Definition: kcoreconfigskeleton.cpp:83
void setLabel(const QString &l)
Set label providing a translated one-line description of the item.
Definition: kcoreconfigskeleton.cpp:73
QString whatsThis() const
Return WhatsThis description of item.
Definition: kcoreconfigskeleton.cpp:98
virtual void readConfig(KConfig *)=0
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
virtual QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kcoreconfigskeleton.cpp:108
void setWhatsThis(const QString &w)
Set WhatsThis description of item.
Definition: kcoreconfigskeleton.cpp:93
void reparseConfiguration()
Updates the state of this object to match the persistent storage.
Definition: kconfig.cpp:557
Class for handling a bool preferences item.
Definition: kcoreconfigskeleton.h:497
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:299
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:285
ItemBool(const QString &_group, const QString &_key, bool &reference, bool defaultValue=true)
Constructor.
Definition: kcoreconfigskeleton.cpp:279
Class for handling a QDateTime preferences item.
Definition: kcoreconfigskeleton.h:857
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:801
ItemDateTime(const QString &_group, const QString &_key, QDateTime &reference, const QDateTime &defaultValue=QDateTime())
Constructor.
Definition: kcoreconfigskeleton.cpp:794
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:815
Class for handling a floating point preference item.
Definition: kcoreconfigskeleton.h:743
ItemDouble(const QString &_group, const QString &_key, double &reference, double defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:636
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:643
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:671
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:661
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:678
QList< Choice > choices() const
Definition: kcoreconfigskeleton.cpp:496
void writeConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.
Definition: kcoreconfigskeleton.cpp:482
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:453
QList< Choice2 > choices2() const
Definition: kcoreconfigskeleton.cpp:506
ItemEnum(const QString &_group, const QString &_key, qint32 &reference, const QList< Choice > &choices, qint32 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:433
Class for handling an integer list preferences item.
Definition: kcoreconfigskeleton.h:951
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:949
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:966
Class for handling a 32-bit integer preferences item.
Definition: kcoreconfigskeleton.h:521
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:317
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:345
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:335
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:352
ItemInt(const QString &_group, const QString &_key, qint32 &reference, qint32 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:310
Class for handling a 64-bit integer preferences item.
Definition: kcoreconfigskeleton.h:566
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:407
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:397
ItemLongLong(const QString &_group, const QString &_key, qint64 &reference, qint64 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:372
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:414
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:379
Class for handling a password preferences item.
Definition: kcoreconfigskeleton.h:423
ItemPassword(const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QLatin1String(""))
Constructor.
Definition: kcoreconfigskeleton.cpp:188
void writeConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.
Definition: kcoreconfigskeleton.cpp:880
ItemPathList(const QString &_group, const QString &_key, QStringList &reference, const QStringList &defaultValue=QStringList())
Constructor.
Definition: kcoreconfigskeleton.cpp:861
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:868
Class for handling a path preferences item.
Definition: kcoreconfigskeleton.h:435
ItemPath(const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QString())
Constructor.
Definition: kcoreconfigskeleton.cpp:195
Class for handling a QPoint preferences item.
Definition: kcoreconfigskeleton.h:809
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:737
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:751
ItemPoint(const QString &_group, const QString &_key, QPoint &reference, const QPoint &defaultValue=QPoint())
Constructor.
Definition: kcoreconfigskeleton.cpp:730
Class for handling a QVariant preferences item.
Definition: kcoreconfigskeleton.h:476
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:254
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:268
ItemProperty(const QString &_group, const QString &_key, QVariant &reference, const QVariant &defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:246
Class for handling a QRect preferences item.
Definition: kcoreconfigskeleton.h:785
ItemRect(const QString &_group, const QString &_key, QRect &reference, const QRect &defaultValue=QRect())
Constructor.
Definition: kcoreconfigskeleton.cpp:698
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:719
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:705
Class for handling a QSize preferences item.
Definition: kcoreconfigskeleton.h:833
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:783
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:769
ItemSize(const QString &_group, const QString &_key, QSize &reference, const QSize &defaultValue=QSize())
Constructor.
Definition: kcoreconfigskeleton.cpp:762
Class for handling a string list preferences item.
Definition: kcoreconfigskeleton.h:882
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:850
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:833
ItemStringList(const QString &_group, const QString &_key, QStringList &reference, const QStringList &defaultValue=QStringList())
Constructor.
Definition: kcoreconfigskeleton.cpp:826
Class for handling a string preferences item.
Definition: kcoreconfigskeleton.h:374
ItemString(const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QLatin1String(""), Type type=Normal)
Constructor.
Definition: kcoreconfigskeleton.cpp:124
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:178
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:150
void writeConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.
Definition: kcoreconfigskeleton.cpp:133
Class for handling an unsigned 32-bit integer preferences item.
Definition: kcoreconfigskeleton.h:658
ItemUInt(const QString &_group, const QString &_key, quint32 &reference, quint32 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:512
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:548
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:520
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:555
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:538
Class for handling unsigned 64-bit integer preferences item.
Definition: kcoreconfigskeleton.h:699
ItemULongLong(const QString &_group, const QString &_key, quint64 &reference, quint64 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:575
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:582
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:617
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:610
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:600
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:930
ItemUrlList(const QString &_group, const QString &_key, KUrl::List &reference, const KUrl::List &defaultValue=KUrl::List())
Constructor.
Definition: kcoreconfigskeleton.cpp:894
void writeConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.
Definition: kcoreconfigskeleton.cpp:913
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:901
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:236
void writeConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.
Definition: kcoreconfigskeleton.cpp:209
ItemUrl(const QString &_group, const QString &_key, KUrl &reference, const KUrl &defaultValue=KUrl())
Constructor.
Definition: kcoreconfigskeleton.cpp:202
void readConfig(KConfig *config)
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.
Definition: kcoreconfigskeleton.cpp:221
KSharedConfig::Ptr mConfig
Definition: kcoreconfigskeleton_p.h:43
QString mCurrentGroup
Definition: kcoreconfigskeleton_p.h:41
KConfigSkeletonItem::Dict mItemDict
Definition: kcoreconfigskeleton_p.h:46
KConfigSkeletonItem::List mItems
Definition: kcoreconfigskeleton_p.h:45
Class for handling preferences settings for an application.
Definition: kcoreconfigskeleton.h:367
ItemSize * addItemSize(const QString &name, QSize &reference, const QSize &defaultValue=QSize(), const QString &key=QString())
Register an item of type QSize.
Definition: kcoreconfigskeleton.cpp:1260
ItemDouble * addItemDouble(const QString &name, double &reference, double defaultValue=0.0, const QString &key=QString())
Register an item of type double.
Definition: kcoreconfigskeleton.cpp:1230
ItemLongLong * addItemLongLong(const QString &name, qint64 &reference, qint64 defaultValue=0, const QString &key=QString())
Register an item of type qint64.
Definition: kcoreconfigskeleton.cpp:1188
KCoreConfigSkeleton(const QString &configname=QString(), QObject *parent=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:978
ItemDateTime * addItemDateTime(const QString &name, QDateTime &reference, const QDateTime &defaultValue=QDateTime(), const QString &key=QString())
Register an item of type QDateTime.
Definition: kcoreconfigskeleton.cpp:1270
void addItem(KConfigSkeletonItem *, const QString &name=QString())
Register a custom KConfigSkeletonItem with a given name.
Definition: kcoreconfigskeleton.cpp:1108
virtual void usrSetDefaults()
Perform the actual setting of default values.
Definition: kcoreconfigskeleton.cpp:1096
ItemULongLong * addItemULongLong(const QString &name, quint64 &reference, quint64 defaultValue=0, const QString &key=QString())
Register an item of type quint64.
Definition: kcoreconfigskeleton.cpp:1209
ItemIntList * addItemIntList(const QString &name, QList< int > &reference, const QList< int > &defaultValue=QList< int >(), const QString &key=QString())
Register an item of type QList<int>.
Definition: kcoreconfigskeleton.cpp:1290
QString currentGroup() const
Returns the current group used for addItem() calls.
Definition: kcoreconfigskeleton.cpp:1013
void setSharedConfig(KSharedConfig::Ptr pConfig)
Set the KSharedConfig object used for reading and writing the settings.
Definition: kcoreconfigskeleton.cpp:1028
KConfigSkeletonItem * findItem(const QString &name)
Lookup item by name.
Definition: kcoreconfigskeleton.cpp:1311
ItemString * addItemString(const QString &name, QString &reference, const QString &defaultValue=QLatin1String(""), const QString &key=QString())
Register an item of type QString.
Definition: kcoreconfigskeleton.cpp:1117
virtual bool usrUseDefaults(bool b)
Implemented by subclasses that use special defaults.
Definition: kcoreconfigskeleton.cpp:1091
void configChanged()
This signal is emitted when the configuration change.
ItemStringList * addItemStringList(const QString &name, QStringList &reference, const QStringList &defaultValue=QStringList(), const QString &key=QString())
Register an item of type QStringList.
Definition: kcoreconfigskeleton.cpp:1280
bool isImmutable(const QString &name)
Return whether a certain item is immutable.
Definition: kcoreconfigskeleton.cpp:1300
KConfig * config()
Return the KConfig object used for reading and writing the settings.
Definition: kcoreconfigskeleton.cpp:1018
ItemPath * addItemPath(const QString &name, QString &reference, const QString &defaultValue=QLatin1String(""), const QString &key=QString())
Register a path item of type QString.
Definition: kcoreconfigskeleton.cpp:1138
KConfigSkeletonItem::List items() const
Return list of items managed by this KCoreConfigSkeleton object.
Definition: kcoreconfigskeleton.cpp:1033
ItemPassword * addItemPassword(const QString &name, QString &reference, const QString &defaultValue=QLatin1String(""), const QString &key=QString())
Register a password item of type QString.
Definition: kcoreconfigskeleton.cpp:1128
ItemProperty * addItemProperty(const QString &name, QVariant &reference, const QVariant &defaultValue=QVariant(), const QString &key=QString())
Register a property item of type QVariant.
Definition: kcoreconfigskeleton.cpp:1148
ItemULongLong * addItemUInt64(const QString &name, quint64 &reference, quint64 defaultValue=0, const QString &key=QString())
Definition: kcoreconfigskeleton.cpp:1220
ItemPoint * addItemPoint(const QString &name, QPoint &reference, const QPoint &defaultValue=QPoint(), const QString &key=QString())
Register an item of type QPoint.
Definition: kcoreconfigskeleton.cpp:1250
ItemLongLong * addItemInt64(const QString &name, qint64 &reference, qint64 defaultValue=0, const QString &key=QString())
Definition: kcoreconfigskeleton.cpp:1199
virtual void usrWriteConfig()
Perform the actual writing of the configuration file.
Definition: kcoreconfigskeleton.cpp:1104
virtual void usrReadConfig()
Perform the actual reading of the configuration file.
Definition: kcoreconfigskeleton.cpp:1100
ItemUInt * addItemUInt(const QString &name, quint32 &reference, quint32 defaultValue=0, const QString &key=QString())
Register an item of type quint32.
Definition: kcoreconfigskeleton.cpp:1178
virtual void setDefaults()
Set all registered items to their default values.
Definition: kcoreconfigskeleton.cpp:1053
ItemInt * addItemInt(const QString &name, qint32 &reference, qint32 defaultValue=0, const QString &key=QString())
Register an item of type qint32.
Definition: kcoreconfigskeleton.cpp:1168
ItemBool * addItemBool(const QString &name, bool &reference, bool defaultValue=false, const QString &key=QString())
Register an item of type bool.
Definition: kcoreconfigskeleton.cpp:1158
virtual bool useDefaults(bool b)
Specify whether this object should reflect the actual values or the default values.
Definition: kcoreconfigskeleton.cpp:1038
void setCurrentGroup(const QString &group)
Set the config file group for subsequent addItem() calls.
Definition: kcoreconfigskeleton.cpp:1008
ItemRect * addItemRect(const QString &name, QRect &reference, const QRect &defaultValue=QRect(), const QString &key=QString())
Register an item of type QRect.
Definition: kcoreconfigskeleton.cpp:1240
static int registerArea(const QByteArray &areaName, bool enabled=true)
Definition: kdebug.cpp:856
KUrl::List is a QList that contains KUrls with a few convenience methods.
Definition: kurl.h:147
Definition: kaboutdata.h:33
static int kCoreConfigSkeletionDebugArea()
Definition: kcoreconfigskeleton.cpp:976
QString obscure(const QString &str)
Obscure string by using a simple symmetric encryption.
Definition: kstringhandler.cpp:190
QString whatsThis
Definition: kcoreconfigskeleton.h:625
QString whatsThis
Definition: kcoreconfigskeleton.h:617
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.