Changeset View
Changeset View
Standalone View
Standalone View
src/core/kcoreconfigskeleton.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | * This class represents one preferences setting as used by @ref KCoreConfigSkeleton. | 47 | * This class represents one preferences setting as used by @ref KCoreConfigSkeleton. | ||
48 | * Subclasses of KConfigSkeletonItem implement storage functions for a certain type of | 48 | * Subclasses of KConfigSkeletonItem implement storage functions for a certain type of | ||
49 | * setting. Normally you don't have to use this class directly. Use the special | 49 | * setting. Normally you don't have to use this class directly. Use the special | ||
50 | * addItem() functions of KCoreConfigSkeleton instead. If you subclass this class you will | 50 | * addItem() functions of KCoreConfigSkeleton instead. If you subclass this class you will | ||
51 | * have to register instances with the function KCoreConfigSkeleton::addItem(). | 51 | * have to register instances with the function KCoreConfigSkeleton::addItem(). | ||
52 | */ | 52 | */ | ||
53 | class KCONFIGCORE_EXPORT KConfigSkeletonItem | 53 | class KCONFIGCORE_EXPORT KConfigSkeletonItem | ||
54 | { | 54 | { | ||
55 | Q_DECLARE_PRIVATE(KConfigSkeletonItem) | ||||
55 | public: | 56 | public: | ||
56 | typedef QList < KConfigSkeletonItem * >List; | 57 | typedef QList < KConfigSkeletonItem * >List; | ||
57 | typedef QHash < QString, KConfigSkeletonItem * > Dict; | 58 | typedef QHash < QString, KConfigSkeletonItem * > Dict; | ||
58 | typedef QHash < QString, KConfigSkeletonItem * >::Iterator DictIterator; | 59 | typedef QHash < QString, KConfigSkeletonItem * >::Iterator DictIterator; | ||
59 | 60 | | |||
60 | /** | 61 | /** | ||
61 | * Constructor. | 62 | * Constructor. | ||
62 | * | 63 | * | ||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | |||||
221 | * Indicates if the item has a different value than the | 222 | * Indicates if the item has a different value than the | ||
222 | * previously loaded value. | 223 | * previously loaded value. | ||
223 | * | 224 | * | ||
224 | * @since 5.64 | 225 | * @since 5.64 | ||
225 | */ | 226 | */ | ||
226 | bool isSaveNeeded() const; | 227 | bool isSaveNeeded() const; | ||
227 | 228 | | |||
228 | protected: | 229 | protected: | ||
230 | explicit KConfigSkeletonItem(KConfigSkeletonItemPrivate &dd, const QString &_group, const QString &_key); | ||||
231 | | ||||
229 | /** | 232 | /** | ||
230 | * sets mIsImmutable to true if mKey in config is immutable | 233 | * sets mIsImmutable to true if mKey in config is immutable | ||
231 | * @param group KConfigGroup to check if mKey is immutable in | 234 | * @param group KConfigGroup to check if mKey is immutable in | ||
232 | */ | 235 | */ | ||
233 | void readImmutability(const KConfigGroup &group); | 236 | void readImmutability(const KConfigGroup &group); | ||
234 | 237 | | |||
235 | QString mGroup; ///< The group name for this item | 238 | QString mGroup; ///< The group name for this item | ||
236 | QString mKey; ///< The config key for this item | 239 | QString mKey; ///< The config key for this item | ||
237 | QString mName; ///< The name of this item | 240 | QString mName; ///< The name of this item | ||
238 | 241 | | |||
239 | // HACK: Necessary to avoid introducing new virtuals in KConfigSkeletonItem | 242 | // HACK: Necessary to avoid introducing new virtuals in KConfigSkeletonItem | ||
240 | // KF6: Use proper pure virtuals in KConfigSkeletonItem | 243 | // KF6: Use proper pure virtuals in KConfigSkeletonItem | ||
241 | void setIsDefaultImpl(const std::function<bool()> &impl); | 244 | void setIsDefaultImpl(const std::function<bool()> &impl); | ||
242 | void setIsSaveNeededImpl(const std::function<bool()> &impl); | 245 | void setIsSaveNeededImpl(const std::function<bool()> &impl); | ||
243 | 246 | | |||
244 | private: | 247 | KConfigSkeletonItemPrivate *const d_ptr; | ||
245 | KConfigSkeletonItemPrivate *const d; | | |||
246 | }; | 248 | }; | ||
247 | 249 | | |||
248 | /** | 250 | /** | ||
249 | * \class KConfigSkeletonGenericItem kcoreconfigskeleton.h <KConfigSkeletonGenericItem> | 251 | * \class KConfigSkeletonGenericItem kcoreconfigskeleton.h <KConfigSkeletonGenericItem> | ||
250 | */ | 252 | */ | ||
251 | template < typename T > class KConfigSkeletonGenericItem: public KConfigSkeletonItem | 253 | template < typename T > class KConfigSkeletonGenericItem: public KConfigSkeletonItem | ||
252 | { | 254 | { | ||
253 | public: | 255 | public: | ||
▲ Show 20 Lines • Show All 1299 Lines • Show Last 20 Lines |