• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • config
kcoreconfigskeleton.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4  Copyright (c) 2003 Waldo Bastian <bastian@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "kcoreconfigskeleton.h"
23 #include "kcoreconfigskeleton_p.h"
24 
25 #include "kstandarddirs.h"
26 #include "kglobal.h"
27 #include "kdebug.h"
28 #include "kstringhandler.h"
29 
30 KConfigSkeletonItem::KConfigSkeletonItem(const QString & _group,
31  const QString & _key)
32  : mGroup(_group)
33  , mKey(_key)
34  , d( new KConfigSkeletonItemPrivate )
35 {
36 }
37 
38 KConfigSkeletonItem::~KConfigSkeletonItem()
39 {
40  delete d;
41 }
42 
43 void KConfigSkeletonItem::setGroup( const QString &_group )
44 {
45  mGroup = _group;
46 }
47 
48 QString KConfigSkeletonItem::group() const
49 {
50  return mGroup;
51 }
52 
53 void KConfigSkeletonItem::setKey( const QString &_key )
54 {
55  mKey = _key;
56 }
57 
58 QString KConfigSkeletonItem::key() const
59 {
60  return mKey;
61 }
62 
63 void KConfigSkeletonItem::setName(const QString &_name)
64 {
65  mName = _name;
66 }
67 
68 QString KConfigSkeletonItem::name() const
69 {
70  return mName;
71 }
72 
73 void KConfigSkeletonItem::setLabel( const QString &l )
74 {
75  d->mLabel = l;
76 }
77 
78 QString KConfigSkeletonItem::label() const
79 {
80  return d->mLabel;
81 }
82 
83 void KConfigSkeletonItem::setToolTip( const QString &t )
84 {
85  d->mToolTip = t;
86 }
87 
88 QString KConfigSkeletonItem::toolTip() const
89 {
90  return d->mToolTip;
91 }
92 
93 void KConfigSkeletonItem::setWhatsThis( const QString &w )
94 {
95  d->mWhatsThis = w;
96 }
97 
98 QString KConfigSkeletonItem::whatsThis() const
99 {
100  return d->mWhatsThis;
101 }
102 
103 QVariant KConfigSkeletonItem::minValue() const
104 {
105  return QVariant();
106 }
107 
108 QVariant KConfigSkeletonItem::maxValue() const
109 {
110  return QVariant();
111 }
112 
113 bool KConfigSkeletonItem::isImmutable() const
114 {
115  return d->mIsImmutable;
116 }
117 
118 void KConfigSkeletonItem::readImmutability( const KConfigGroup &group )
119 {
120  d->mIsImmutable = group.isEntryImmutable( mKey );
121 }
122 
123 
124 KCoreConfigSkeleton::ItemString::ItemString( const QString &_group, const QString &_key,
125  QString &reference,
126  const QString &defaultValue,
127  Type type )
128  : KConfigSkeletonGenericItem<QString>( _group, _key, reference, defaultValue ),
129  mType( type )
130 {
131 }
132 
133 void KCoreConfigSkeleton::ItemString::writeConfig( KConfig *config )
134 {
135  if ( mReference != mLoadedValue ) // WABA: Is this test needed?
136  {
137  KConfigGroup cg(config, mGroup );
138  if ((mDefault == mReference) && !cg.hasDefault( mKey))
139  cg.revertToDefault( mKey );
140  else if ( mType == Path )
141  cg.writePathEntry( mKey, mReference );
142  else if ( mType == Password )
143  cg.writeEntry( mKey, KStringHandler::obscure( mReference ) );
144  else
145  cg.writeEntry( mKey, mReference );
146  }
147 }
148 
149 
150 void KCoreConfigSkeleton::ItemString::readConfig( KConfig *config )
151 {
152  KConfigGroup cg(config, mGroup );
153 
154  if ( mType == Path )
155  {
156  mReference = cg.readPathEntry( mKey, mDefault );
157  }
158  else if ( mType == Password )
159  {
160  QString val = cg.readEntry( mKey, KStringHandler::obscure( mDefault ) );
161  mReference = KStringHandler::obscure( val );
162  }
163  else
164  {
165  mReference = cg.readEntry( mKey, mDefault );
166  }
167 
168  mLoadedValue = mReference;
169 
170  readImmutability( cg );
171 }
172 
173 void KCoreConfigSkeleton::ItemString::setProperty(const QVariant & p)
174 {
175  mReference = p.toString();
176 }
177 
178 bool KCoreConfigSkeleton::ItemString::isEqual(const QVariant &v) const
179 {
180  return mReference == v.toString();
181 }
182 
183 QVariant KCoreConfigSkeleton::ItemString::property() const
184 {
185  return QVariant(mReference);
186 }
187 
188 KCoreConfigSkeleton::ItemPassword::ItemPassword( const QString &_group, const QString &_key,
189  QString &reference,
190  const QString &defaultValue)
191  : ItemString( _group, _key, reference, defaultValue, Password )
192 {
193 }
194 
195 KCoreConfigSkeleton::ItemPath::ItemPath( const QString &_group, const QString &_key,
196  QString &reference,
197  const QString &defaultValue)
198  : ItemString( _group, _key, reference, defaultValue, Path )
199 {
200 }
201 
202 KCoreConfigSkeleton::ItemUrl::ItemUrl( const QString &_group, const QString &_key,
203  KUrl &reference,
204  const KUrl &defaultValue )
205  : KConfigSkeletonGenericItem<KUrl>( _group, _key, reference, defaultValue )
206 {
207 }
208 
209 void KCoreConfigSkeleton::ItemUrl::writeConfig( KConfig *config )
210 {
211  if ( mReference != mLoadedValue ) // WABA: Is this test needed?
212  {
213  KConfigGroup cg(config, mGroup );
214  if ((mDefault == mReference) && !cg.hasDefault( mKey))
215  cg.revertToDefault( mKey );
216  else
217  cg.writeEntry<QString>( mKey, mReference.url() );
218  }
219 }
220 
221 void KCoreConfigSkeleton::ItemUrl::readConfig( KConfig *config )
222 {
223  KConfigGroup cg(config, mGroup );
224 
225  mReference = KUrl( cg.readEntry<QString>( mKey, mDefault.url() ) );
226  mLoadedValue = mReference;
227 
228  readImmutability( cg );
229 }
230 
231 void KCoreConfigSkeleton::ItemUrl::setProperty(const QVariant & p)
232 {
233  mReference = qvariant_cast<KUrl>(p);
234 }
235 
236 bool KCoreConfigSkeleton::ItemUrl::isEqual(const QVariant &v) const
237 {
238  return mReference == qvariant_cast<KUrl>(v);
239 }
240 
241 QVariant KCoreConfigSkeleton::ItemUrl::property() const
242 {
243  return qVariantFromValue<KUrl>(mReference);
244 }
245 
246 KCoreConfigSkeleton::ItemProperty::ItemProperty( const QString &_group,
247  const QString &_key,
248  QVariant &reference,
249  const QVariant &defaultValue )
250  : KConfigSkeletonGenericItem<QVariant>( _group, _key, reference, defaultValue )
251 {
252 }
253 
254 void KCoreConfigSkeleton::ItemProperty::readConfig( KConfig *config )
255 {
256  KConfigGroup cg(config, mGroup );
257  mReference = cg.readEntry( mKey, mDefault );
258  mLoadedValue = mReference;
259 
260  readImmutability( cg );
261 }
262 
263 void KCoreConfigSkeleton::ItemProperty::setProperty(const QVariant & p)
264 {
265  mReference = p;
266 }
267 
268 bool KCoreConfigSkeleton::ItemProperty::isEqual(const QVariant &v) const
269 {
270  //this might cause problems if the QVariants are not of default types
271  return mReference == v;
272 }
273 
274 QVariant KCoreConfigSkeleton::ItemProperty::property() const
275 {
276  return mReference;
277 }
278 
279 KCoreConfigSkeleton::ItemBool::ItemBool( const QString &_group, const QString &_key,
280  bool &reference, bool defaultValue )
281  : KConfigSkeletonGenericItem<bool>( _group, _key, reference, defaultValue )
282 {
283 }
284 
285 void KCoreConfigSkeleton::ItemBool::readConfig( KConfig *config )
286 {
287  KConfigGroup cg(config, mGroup );
288  mReference = cg.readEntry( mKey, mDefault );
289  mLoadedValue = mReference;
290 
291  readImmutability( cg );
292 }
293 
294 void KCoreConfigSkeleton::ItemBool::setProperty(const QVariant & p)
295 {
296  mReference = p.toBool();
297 }
298 
299 bool KCoreConfigSkeleton::ItemBool::isEqual(const QVariant &v) const
300 {
301  return mReference == v.toBool();
302 }
303 
304 QVariant KCoreConfigSkeleton::ItemBool::property() const
305 {
306  return QVariant( mReference );
307 }
308 
309 
310 KCoreConfigSkeleton::ItemInt::ItemInt( const QString &_group, const QString &_key,
311  qint32 &reference, qint32 defaultValue )
312  : KConfigSkeletonGenericItem<qint32>( _group, _key, reference, defaultValue )
313  ,mHasMin(false), mHasMax(false)
314 {
315 }
316 
317 void KCoreConfigSkeleton::ItemInt::readConfig( KConfig *config )
318 {
319  KConfigGroup cg(config, mGroup );
320  mReference = cg.readEntry( mKey, mDefault );
321  if (mHasMin)
322  mReference = qMax(mReference, mMin);
323  if (mHasMax)
324  mReference = qMin(mReference, mMax);
325  mLoadedValue = mReference;
326 
327  readImmutability( cg );
328 }
329 
330 void KCoreConfigSkeleton::ItemInt::setProperty(const QVariant & p)
331 {
332  mReference = p.toInt();
333 }
334 
335 bool KCoreConfigSkeleton::ItemInt::isEqual(const QVariant &v) const
336 {
337  return mReference == v.toInt();
338 }
339 
340 QVariant KCoreConfigSkeleton::ItemInt::property() const
341 {
342  return QVariant(mReference);
343 }
344 
345 QVariant KCoreConfigSkeleton::ItemInt::minValue() const
346 {
347  if (mHasMin)
348  return QVariant(mMin);
349  return QVariant();
350 }
351 
352 QVariant KCoreConfigSkeleton::ItemInt::maxValue() const
353 {
354  if (mHasMax)
355  return QVariant(mMax);
356  return QVariant();
357 }
358 
359 void KCoreConfigSkeleton::ItemInt::setMinValue(qint32 v)
360 {
361  mHasMin = true;
362  mMin = v;
363 }
364 
365 void KCoreConfigSkeleton::ItemInt::setMaxValue(qint32 v)
366 {
367  mHasMax = true;
368  mMax = v;
369 }
370 
371 
372 KCoreConfigSkeleton::ItemLongLong::ItemLongLong( const QString &_group, const QString &_key,
373  qint64 &reference, qint64 defaultValue )
374  : KConfigSkeletonGenericItem<qint64>( _group, _key, reference, defaultValue )
375  ,mHasMin(false), mHasMax(false)
376 {
377 }
378 
379 void KCoreConfigSkeleton::ItemLongLong::readConfig( KConfig *config )
380 {
381  KConfigGroup cg(config, mGroup );
382  mReference = cg.readEntry( mKey, mDefault );
383  if (mHasMin)
384  mReference = qMax(mReference, mMin);
385  if (mHasMax)
386  mReference = qMin(mReference, mMax);
387  mLoadedValue = mReference;
388 
389  readImmutability( cg );
390 }
391 
392 void KCoreConfigSkeleton::ItemLongLong::setProperty(const QVariant & p)
393 {
394  mReference = p.toLongLong();
395 }
396 
397 bool KCoreConfigSkeleton::ItemLongLong::isEqual(const QVariant &v) const
398 {
399  return mReference == v.toLongLong();
400 }
401 
402 QVariant KCoreConfigSkeleton::ItemLongLong::property() const
403 {
404  return QVariant(mReference);
405 }
406 
407 QVariant KCoreConfigSkeleton::ItemLongLong::minValue() const
408 {
409  if (mHasMin)
410  return QVariant(mMin);
411  return QVariant();
412 }
413 
414 QVariant KCoreConfigSkeleton::ItemLongLong::maxValue() const
415 {
416  if (mHasMax)
417  return QVariant(mMax);
418  return QVariant();
419 }
420 
421 void KCoreConfigSkeleton::ItemLongLong::setMinValue(qint64 v)
422 {
423  mHasMin = true;
424  mMin = v;
425 }
426 
427 void KCoreConfigSkeleton::ItemLongLong::setMaxValue(qint64 v)
428 {
429  mHasMax = true;
430  mMax = v;
431 }
432 
433 KCoreConfigSkeleton::ItemEnum::ItemEnum( const QString &_group, const QString &_key,
434  qint32 &reference,
435  const QList<Choice> &choices,
436  qint32 defaultValue )
437  : ItemInt( _group, _key, reference, defaultValue )
438 {
439  foreach (const ItemEnum::Choice &c, choices) {
440  ItemEnum::Choice2 cc = { c.name, c.label, QString(), c.whatsThis };
441  mChoices.append(cc);
442  }
443 }
444 
445 KCoreConfigSkeleton::ItemEnum::ItemEnum( const QString &_group, const QString &_key,
446  qint32 &reference,
447  const QList<Choice2> &choices,
448  qint32 defaultValue )
449  : ItemInt( _group, _key, reference, defaultValue ), mChoices(choices)
450 {
451 }
452 
453 void KCoreConfigSkeleton::ItemEnum::readConfig( KConfig *config )
454 {
455  KConfigGroup cg(config, mGroup );
456  if (!cg.hasKey(mKey))
457  {
458  mReference = mDefault;
459  }
460  else
461  {
462  int i = 0;
463  mReference = -1;
464  QString tmp = cg.readEntry( mKey, QString() ).toLower();
465  for(QList<Choice2>::ConstIterator it = mChoices.constBegin();
466  it != mChoices.constEnd(); ++it, ++i)
467  {
468  if ((*it).name.toLower() == tmp)
469  {
470  mReference = i;
471  break;
472  }
473  }
474  if (mReference == -1)
475  mReference = cg.readEntry( mKey, mDefault );
476  }
477  mLoadedValue = mReference;
478 
479  readImmutability( cg );
480 }
481 
482 void KCoreConfigSkeleton::ItemEnum::writeConfig( KConfig *config )
483 {
484  if ( mReference != mLoadedValue ) // WABA: Is this test needed?
485  {
486  KConfigGroup cg(config, mGroup );
487  if ((mDefault == mReference) && !cg.hasDefault( mKey))
488  cg.revertToDefault( mKey );
489  else if ((mReference >= 0) && (mReference < (int) mChoices.count()))
490  cg.writeEntry( mKey, mChoices[mReference].name );
491  else
492  cg.writeEntry( mKey, mReference );
493  }
494 }
495 
496 QList<KCoreConfigSkeleton::ItemEnum::Choice> KCoreConfigSkeleton::ItemEnum::choices() const
497 {
498  QList<KCoreConfigSkeleton::ItemEnum::Choice> r;
499  foreach (const KCoreConfigSkeleton::ItemEnum::Choice2 &c, mChoices) {
500  KCoreConfigSkeleton::ItemEnum::Choice cc = { c.name, c.label, c.whatsThis };
501  r.append(cc);
502  }
503  return r;
504 }
505 
506 QList<KCoreConfigSkeleton::ItemEnum::Choice2> KCoreConfigSkeleton::ItemEnum::choices2() const
507 {
508  return mChoices;
509 }
510 
511 
512 KCoreConfigSkeleton::ItemUInt::ItemUInt( const QString &_group, const QString &_key,
513  quint32 &reference,
514  quint32 defaultValue )
515  : KConfigSkeletonGenericItem<quint32>( _group, _key, reference, defaultValue )
516  ,mHasMin(false), mHasMax(false)
517 {
518 }
519 
520 void KCoreConfigSkeleton::ItemUInt::readConfig( KConfig *config )
521 {
522  KConfigGroup cg(config, mGroup );
523  mReference = cg.readEntry( mKey, mDefault );
524  if (mHasMin)
525  mReference = qMax(mReference, mMin);
526  if (mHasMax)
527  mReference = qMin(mReference, mMax);
528  mLoadedValue = mReference;
529 
530  readImmutability( cg );
531 }
532 
533 void KCoreConfigSkeleton::ItemUInt::setProperty(const QVariant & p)
534 {
535  mReference = p.toUInt();
536 }
537 
538 bool KCoreConfigSkeleton::ItemUInt::isEqual(const QVariant &v) const
539 {
540  return mReference == v.toUInt();
541 }
542 
543 QVariant KCoreConfigSkeleton::ItemUInt::property() const
544 {
545  return QVariant(mReference);
546 }
547 
548 QVariant KCoreConfigSkeleton::ItemUInt::minValue() const
549 {
550  if (mHasMin)
551  return QVariant(mMin);
552  return QVariant();
553 }
554 
555 QVariant KCoreConfigSkeleton::ItemUInt::maxValue() const
556 {
557  if (mHasMax)
558  return QVariant(mMax);
559  return QVariant();
560 }
561 
562 void KCoreConfigSkeleton::ItemUInt::setMinValue(quint32 v)
563 {
564  mHasMin = true;
565  mMin = v;
566 }
567 
568 void KCoreConfigSkeleton::ItemUInt::setMaxValue(quint32 v)
569 {
570  mHasMax = true;
571  mMax = v;
572 }
573 
574 
575 KCoreConfigSkeleton::ItemULongLong::ItemULongLong( const QString &_group, const QString &_key,
576  quint64 &reference, quint64 defaultValue )
577  : KConfigSkeletonGenericItem<quint64>( _group, _key, reference, defaultValue )
578  ,mHasMin(false), mHasMax(false)
579 {
580 }
581 
582 void KCoreConfigSkeleton::ItemULongLong::readConfig( KConfig *config )
583 {
584  KConfigGroup cg(config, mGroup );
585  mReference = cg.readEntry( mKey, mDefault );
586  if (mHasMin)
587  mReference = qMax(mReference, mMin);
588  if (mHasMax)
589  mReference = qMin(mReference, mMax);
590  mLoadedValue = mReference;
591 
592  readImmutability( cg );
593 }
594 
595 void KCoreConfigSkeleton::ItemULongLong::setProperty(const QVariant & p)
596 {
597  mReference = p.toULongLong();
598 }
599 
600 bool KCoreConfigSkeleton::ItemULongLong::isEqual(const QVariant &v) const
601 {
602  return mReference == v.toULongLong();
603 }
604 
605 QVariant KCoreConfigSkeleton::ItemULongLong::property() const
606 {
607  return QVariant(mReference);
608 }
609 
610 QVariant KCoreConfigSkeleton::ItemULongLong::minValue() const
611 {
612  if (mHasMin)
613  return QVariant(mMin);
614  return QVariant();
615 }
616 
617 QVariant KCoreConfigSkeleton::ItemULongLong::maxValue() const
618 {
619  if (mHasMax)
620  return QVariant(mMax);
621  return QVariant();
622 }
623 
624 void KCoreConfigSkeleton::ItemULongLong::setMinValue(quint64 v)
625 {
626  mHasMin = true;
627  mMin = v;
628 }
629 
630 void KCoreConfigSkeleton::ItemULongLong::setMaxValue(quint64 v)
631 {
632  mHasMax = true;
633  mMax = v;
634 }
635 
636 KCoreConfigSkeleton::ItemDouble::ItemDouble( const QString &_group, const QString &_key,
637  double &reference, double defaultValue )
638  : KConfigSkeletonGenericItem<double>( _group, _key, reference, defaultValue )
639  ,mHasMin(false), mHasMax(false)
640 {
641 }
642 
643 void KCoreConfigSkeleton::ItemDouble::readConfig( KConfig *config )
644 {
645  KConfigGroup cg(config, mGroup );
646  mReference = cg.readEntry( mKey, mDefault );
647  if (mHasMin)
648  mReference = qMax(mReference, mMin);
649  if (mHasMax)
650  mReference = qMin(mReference, mMax);
651  mLoadedValue = mReference;
652 
653  readImmutability( cg );
654 }
655 
656 void KCoreConfigSkeleton::ItemDouble::setProperty(const QVariant & p)
657 {
658  mReference = p.toDouble();
659 }
660 
661 bool KCoreConfigSkeleton::ItemDouble::isEqual(const QVariant &v) const
662 {
663  return mReference == v.toDouble();
664 }
665 
666 QVariant KCoreConfigSkeleton::ItemDouble::property() const
667 {
668  return QVariant(mReference);
669 }
670 
671 QVariant KCoreConfigSkeleton::ItemDouble::minValue() const
672 {
673  if (mHasMin)
674  return QVariant(mMin);
675  return QVariant();
676 }
677 
678 QVariant KCoreConfigSkeleton::ItemDouble::maxValue() const
679 {
680  if (mHasMax)
681  return QVariant(mMax);
682  return QVariant();
683 }
684 
685 void KCoreConfigSkeleton::ItemDouble::setMinValue(double v)
686 {
687  mHasMin = true;
688  mMin = v;
689 }
690 
691 void KCoreConfigSkeleton::ItemDouble::setMaxValue(double v)
692 {
693  mHasMax = true;
694  mMax = v;
695 }
696 
697 
698 KCoreConfigSkeleton::ItemRect::ItemRect( const QString &_group, const QString &_key,
699  QRect &reference,
700  const QRect &defaultValue )
701  : KConfigSkeletonGenericItem<QRect>( _group, _key, reference, defaultValue )
702 {
703 }
704 
705 void KCoreConfigSkeleton::ItemRect::readConfig( KConfig *config )
706 {
707  KConfigGroup cg(config, mGroup );
708  mReference = cg.readEntry( mKey, mDefault );
709  mLoadedValue = mReference;
710 
711  readImmutability( cg );
712 }
713 
714 void KCoreConfigSkeleton::ItemRect::setProperty(const QVariant & p)
715 {
716  mReference = p.toRect();
717 }
718 
719 bool KCoreConfigSkeleton::ItemRect::isEqual(const QVariant &v) const
720 {
721  return mReference == v.toRect();
722 }
723 
724 QVariant KCoreConfigSkeleton::ItemRect::property() const
725 {
726  return QVariant(mReference);
727 }
728 
729 
730 KCoreConfigSkeleton::ItemPoint::ItemPoint( const QString &_group, const QString &_key,
731  QPoint &reference,
732  const QPoint &defaultValue )
733  : KConfigSkeletonGenericItem<QPoint>( _group, _key, reference, defaultValue )
734 {
735 }
736 
737 void KCoreConfigSkeleton::ItemPoint::readConfig( KConfig *config )
738 {
739  KConfigGroup cg(config, mGroup );
740  mReference = cg.readEntry( mKey, mDefault );
741  mLoadedValue = mReference;
742 
743  readImmutability( cg );
744 }
745 
746 void KCoreConfigSkeleton::ItemPoint::setProperty(const QVariant & p)
747 {
748  mReference = p.toPoint();
749 }
750 
751 bool KCoreConfigSkeleton::ItemPoint::isEqual(const QVariant &v) const
752 {
753  return mReference == v.toPoint();
754 }
755 
756 QVariant KCoreConfigSkeleton::ItemPoint::property() const
757 {
758  return QVariant(mReference);
759 }
760 
761 
762 KCoreConfigSkeleton::ItemSize::ItemSize( const QString &_group, const QString &_key,
763  QSize &reference,
764  const QSize &defaultValue )
765  : KConfigSkeletonGenericItem<QSize>( _group, _key, reference, defaultValue )
766 {
767 }
768 
769 void KCoreConfigSkeleton::ItemSize::readConfig( KConfig *config )
770 {
771  KConfigGroup cg(config, mGroup );
772  mReference = cg.readEntry( mKey, mDefault );
773  mLoadedValue = mReference;
774 
775  readImmutability( cg );
776 }
777 
778 void KCoreConfigSkeleton::ItemSize::setProperty(const QVariant & p)
779 {
780  mReference = p.toSize();
781 }
782 
783 bool KCoreConfigSkeleton::ItemSize::isEqual(const QVariant &v) const
784 {
785  return mReference == v.toSize();
786 }
787 
788 QVariant KCoreConfigSkeleton::ItemSize::property() const
789 {
790  return QVariant(mReference);
791 }
792 
793 
794 KCoreConfigSkeleton::ItemDateTime::ItemDateTime( const QString &_group, const QString &_key,
795  QDateTime &reference,
796  const QDateTime &defaultValue )
797  : KConfigSkeletonGenericItem<QDateTime>( _group, _key, reference, defaultValue )
798 {
799 }
800 
801 void KCoreConfigSkeleton::ItemDateTime::readConfig( KConfig *config )
802 {
803  KConfigGroup cg(config, mGroup );
804  mReference = cg.readEntry( mKey, mDefault );
805  mLoadedValue = mReference;
806 
807  readImmutability( cg );
808 }
809 
810 void KCoreConfigSkeleton::ItemDateTime::setProperty(const QVariant & p)
811 {
812  mReference = p.toDateTime();
813 }
814 
815 bool KCoreConfigSkeleton::ItemDateTime::isEqual(const QVariant &v) const
816 {
817  return mReference == v.toDateTime();
818 }
819 
820 QVariant KCoreConfigSkeleton::ItemDateTime::property() const
821 {
822  return QVariant(mReference);
823 }
824 
825 
826 KCoreConfigSkeleton::ItemStringList::ItemStringList( const QString &_group, const QString &_key,
827  QStringList &reference,
828  const QStringList &defaultValue )
829  : KConfigSkeletonGenericItem<QStringList>( _group, _key, reference, defaultValue )
830 {
831 }
832 
833 void KCoreConfigSkeleton::ItemStringList::readConfig( KConfig *config )
834 {
835  KConfigGroup cg(config, mGroup );
836  if ( !cg.hasKey( mKey ) )
837  mReference = mDefault;
838  else
839  mReference = cg.readEntry( mKey, mDefault );
840  mLoadedValue = mReference;
841 
842  readImmutability( cg );
843 }
844 
845 void KCoreConfigSkeleton::ItemStringList::setProperty(const QVariant & p)
846 {
847  mReference = p.toStringList();
848 }
849 
850 bool KCoreConfigSkeleton::ItemStringList::isEqual(const QVariant &v) const
851 {
852  return mReference == v.toStringList();
853 }
854 
855 QVariant KCoreConfigSkeleton::ItemStringList::property() const
856 {
857  return QVariant(mReference);
858 }
859 
860 
861 KCoreConfigSkeleton::ItemPathList::ItemPathList( const QString &_group, const QString &_key,
862  QStringList &reference,
863  const QStringList &defaultValue )
864  : ItemStringList( _group, _key, reference, defaultValue )
865 {
866 }
867 
868 void KCoreConfigSkeleton::ItemPathList::readConfig( KConfig *config )
869 {
870  KConfigGroup cg(config, mGroup );
871  if ( !cg.hasKey( mKey ) )
872  mReference = mDefault;
873  else
874  mReference = cg.readPathEntry( mKey, QStringList() );
875  mLoadedValue = mReference;
876 
877  readImmutability( cg );
878 }
879 
880 void KCoreConfigSkeleton::ItemPathList::writeConfig( KConfig *config )
881 {
882  if ( mReference != mLoadedValue ) // WABA: Is this test needed?
883  {
884  KConfigGroup cg(config, mGroup );
885  if ((mDefault == mReference) && !cg.hasDefault( mKey))
886  cg.revertToDefault( mKey );
887  else {
888  QStringList sl = mReference;
889  cg.writePathEntry( mKey, sl );
890  }
891  }
892 }
893 
894 KCoreConfigSkeleton::ItemUrlList::ItemUrlList( const QString &_group, const QString &_key,
895  KUrl::List &reference,
896  const KUrl::List &defaultValue )
897  : KConfigSkeletonGenericItem<KUrl::List>( _group, _key, reference, defaultValue )
898 {
899 }
900 
901 void KCoreConfigSkeleton::ItemUrlList::readConfig( KConfig *config )
902 {
903  KConfigGroup cg(config, mGroup );
904  if ( !cg.hasKey( mKey ) )
905  mReference = mDefault;
906  else
907  mReference = KUrl::List( cg.readEntry<QStringList>( mKey, mDefault.toStringList() ) );
908  mLoadedValue = mReference;
909 
910  readImmutability( cg );
911 }
912 
913 void KCoreConfigSkeleton::ItemUrlList::writeConfig( KConfig *config )
914 {
915  if ( mReference != mLoadedValue ) // WABA: Is this test needed?
916  {
917  KConfigGroup cg(config, mGroup );
918  if ((mDefault == mReference) && !cg.hasDefault( mKey))
919  cg.revertToDefault( mKey );
920  else
921  cg.writeEntry<QStringList>( mKey, mReference.toStringList() );
922  }
923 }
924 
925 void KCoreConfigSkeleton::ItemUrlList::setProperty(const QVariant & p)
926 {
927  mReference = qvariant_cast<KUrl::List>(p);
928 }
929 
930 bool KCoreConfigSkeleton::ItemUrlList::isEqual(const QVariant &v) const
931 {
932  return mReference == qvariant_cast<KUrl::List>(v);
933 }
934 
935 QVariant KCoreConfigSkeleton::ItemUrlList::property() const
936 {
937  return qVariantFromValue<KUrl::List>(mReference);
938 }
939 
940 Q_DECLARE_METATYPE( QList<int> )
941 
942 KCoreConfigSkeleton::ItemIntList::ItemIntList( const QString &_group, const QString &_key,
943  QList<int> &reference,
944  const QList<int> &defaultValue )
945  : KConfigSkeletonGenericItem<QList<int> >( _group, _key, reference, defaultValue )
946 {
947 }
948 
949 void KCoreConfigSkeleton::ItemIntList::readConfig( KConfig *config )
950 {
951  KConfigGroup cg(config, mGroup );
952  if ( !cg.hasKey( mKey ) )
953  mReference = mDefault;
954  else
955  mReference = cg.readEntry( mKey , mDefault );
956  mLoadedValue = mReference;
957 
958  readImmutability( cg );
959 }
960 
961 void KCoreConfigSkeleton::ItemIntList::setProperty(const QVariant &p)
962 {
963  mReference = qvariant_cast< QList<int> >(p);
964 }
965 
966 bool KCoreConfigSkeleton::ItemIntList::isEqual(const QVariant &v) const
967 {
968  return mReference == qvariant_cast< QList<int> >(v);
969 }
970 
971 QVariant KCoreConfigSkeleton::ItemIntList::property() const
972 {
973  return qVariantFromValue< QList<int> >(mReference);
974 }
975 
976 static int kCoreConfigSkeletionDebugArea() { static int s_area = KDebug::registerArea("kdecore (KConfigSkeleton)"); return s_area; }
977 
978 KCoreConfigSkeleton::KCoreConfigSkeleton(const QString &configname, QObject* parent)
979  : QObject(parent),
980  d( new Private )
981 {
982  //kDebug(kCoreConfigSkeletionDebugArea()) << "Creating KCoreConfigSkeleton (" << (void *)this << ")";
983 
984  if ( !configname.isEmpty() )
985  {
986  d->mConfig = KSharedConfig::openConfig( configname );
987  }
988  else
989  {
990  d->mConfig = KGlobal::config();
991  }
992 }
993 
994 KCoreConfigSkeleton::KCoreConfigSkeleton(KSharedConfig::Ptr pConfig, QObject* parent)
995  : QObject(parent),
996  d( new Private )
997 {
998  //kDebug(kCoreConfigSkeletionDebugArea()) << "Creating KCoreConfigSkeleton (" << (void *)this << ")";
999  d->mConfig = pConfig;
1000 }
1001 
1002 
1003 KCoreConfigSkeleton::~KCoreConfigSkeleton()
1004 {
1005  delete d;
1006 }
1007 
1008 void KCoreConfigSkeleton::setCurrentGroup( const QString &group )
1009 {
1010  d->mCurrentGroup = group;
1011 }
1012 
1013 QString KCoreConfigSkeleton::currentGroup() const
1014 {
1015  return d->mCurrentGroup;
1016 }
1017 
1018 KConfig *KCoreConfigSkeleton::config()
1019 {
1020  return d->mConfig.data();
1021 }
1022 
1023 const KConfig *KCoreConfigSkeleton::config() const
1024 {
1025  return d->mConfig.data();
1026 }
1027 
1028 void KCoreConfigSkeleton::setSharedConfig(KSharedConfig::Ptr pConfig)
1029 {
1030  d->mConfig = pConfig;
1031 }
1032 
1033 KConfigSkeletonItem::List KCoreConfigSkeleton::items() const
1034 {
1035  return d->mItems;
1036 }
1037 
1038 bool KCoreConfigSkeleton::useDefaults(bool b)
1039 {
1040  if (b == d->mUseDefaults)
1041  return d->mUseDefaults;
1042 
1043  d->mUseDefaults = b;
1044  KConfigSkeletonItem::List::ConstIterator it;
1045  for( it = d->mItems.constBegin(); it != d->mItems.constEnd(); ++it )
1046  {
1047  (*it)->swapDefault();
1048  }
1049  usrUseDefaults(b);
1050  return !d->mUseDefaults;
1051 }
1052 
1053 void KCoreConfigSkeleton::setDefaults()
1054 {
1055  KConfigSkeletonItem::List::ConstIterator it;
1056  for( it = d->mItems.constBegin(); it != d->mItems.constEnd(); ++it ) {
1057  (*it)->setDefault();
1058  }
1059  usrSetDefaults();
1060 }
1061 
1062 void KCoreConfigSkeleton::readConfig()
1063 {
1064  // kDebug(kCoreConfigSkeletionDebugArea());
1065  d->mConfig->reparseConfiguration();
1066  KConfigSkeletonItem::List::ConstIterator it;
1067  for( it = d->mItems.constBegin(); it != d->mItems.constEnd(); ++it )
1068  {
1069  (*it)->readConfig( d->mConfig.data() );
1070  }
1071  usrReadConfig();
1072 }
1073 
1074 void KCoreConfigSkeleton::writeConfig()
1075 {
1076  kDebug(kCoreConfigSkeletionDebugArea());
1077  KConfigSkeletonItem::List::ConstIterator it;
1078  for( it = d->mItems.constBegin(); it != d->mItems.constEnd(); ++it )
1079  {
1080  (*it)->writeConfig( d->mConfig.data() );
1081  }
1082  usrWriteConfig();
1083 
1084  if (d->mConfig->isDirty()) {
1085  d->mConfig->sync();
1086  readConfig();
1087  emit configChanged();
1088  }
1089 }
1090 
1091 bool KCoreConfigSkeleton::usrUseDefaults(bool)
1092 {
1093  return false;
1094 }
1095 
1096 void KCoreConfigSkeleton::usrSetDefaults()
1097 {
1098 }
1099 
1100 void KCoreConfigSkeleton::usrReadConfig()
1101 {
1102 }
1103 
1104 void KCoreConfigSkeleton::usrWriteConfig()
1105 {
1106 }
1107 
1108 void KCoreConfigSkeleton::addItem( KConfigSkeletonItem *item, const QString &name )
1109 {
1110  item->setName( name.isEmpty() ? item->key() : name );
1111  d->mItems.append( item );
1112  d->mItemDict.insert( item->name(), item );
1113  item->readDefault( d->mConfig.data() );
1114  item->readConfig( d->mConfig.data() );
1115 }
1116 
1117 KCoreConfigSkeleton::ItemString *KCoreConfigSkeleton::addItemString( const QString &name, QString &reference,
1118  const QString &defaultValue, const QString &key )
1119 {
1120  KCoreConfigSkeleton::ItemString *item;
1121  item = new KCoreConfigSkeleton::ItemString( d->mCurrentGroup, key.isEmpty() ? name : key,
1122  reference, defaultValue,
1123  KCoreConfigSkeleton::ItemString::Normal );
1124  addItem( item, name );
1125  return item;
1126 }
1127 
1128 KCoreConfigSkeleton::ItemPassword *KCoreConfigSkeleton::addItemPassword( const QString &name, QString &reference,
1129  const QString &defaultValue, const QString &key )
1130 {
1131  KCoreConfigSkeleton::ItemPassword *item;
1132  item = new KCoreConfigSkeleton::ItemPassword( d->mCurrentGroup, key.isNull() ? name : key,
1133  reference, defaultValue );
1134  addItem( item, name );
1135  return item;
1136 }
1137 
1138 KCoreConfigSkeleton::ItemPath *KCoreConfigSkeleton::addItemPath( const QString &name, QString &reference,
1139  const QString &defaultValue, const QString &key )
1140 {
1141  KCoreConfigSkeleton::ItemPath *item;
1142  item = new KCoreConfigSkeleton::ItemPath( d->mCurrentGroup, key.isNull() ? name : key,
1143  reference, defaultValue );
1144  addItem( item, name );
1145  return item;
1146 }
1147 
1148 KCoreConfigSkeleton::ItemProperty *KCoreConfigSkeleton::addItemProperty( const QString &name, QVariant &reference,
1149  const QVariant &defaultValue, const QString &key )
1150 {
1151  KCoreConfigSkeleton::ItemProperty *item;
1152  item = new KCoreConfigSkeleton::ItemProperty( d->mCurrentGroup, key.isNull() ? name : key,
1153  reference, defaultValue );
1154  addItem( item, name );
1155  return item;
1156 }
1157 
1158 KCoreConfigSkeleton::ItemBool *KCoreConfigSkeleton::addItemBool( const QString &name, bool &reference,
1159  bool defaultValue, const QString &key )
1160 {
1161  KCoreConfigSkeleton::ItemBool *item;
1162  item = new KCoreConfigSkeleton::ItemBool( d->mCurrentGroup, key.isNull() ? name : key,
1163  reference, defaultValue );
1164  addItem( item, name );
1165  return item;
1166 }
1167 
1168 KCoreConfigSkeleton::ItemInt *KCoreConfigSkeleton::addItemInt( const QString &name, qint32 &reference,
1169  qint32 defaultValue, const QString &key )
1170 {
1171  KCoreConfigSkeleton::ItemInt *item;
1172  item = new KCoreConfigSkeleton::ItemInt( d->mCurrentGroup, key.isNull() ? name : key,
1173  reference, defaultValue );
1174  addItem( item, name );
1175  return item;
1176 }
1177 
1178 KCoreConfigSkeleton::ItemUInt *KCoreConfigSkeleton::addItemUInt( const QString &name, quint32 &reference,
1179  quint32 defaultValue, const QString &key )
1180 {
1181  KCoreConfigSkeleton::ItemUInt *item;
1182  item = new KCoreConfigSkeleton::ItemUInt( d->mCurrentGroup, key.isNull() ? name : key,
1183  reference, defaultValue );
1184  addItem( item, name );
1185  return item;
1186 }
1187 
1188 KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemLongLong( const QString &name, qint64 &reference,
1189  qint64 defaultValue, const QString &key )
1190 {
1191  KCoreConfigSkeleton::ItemLongLong *item;
1192  item = new KCoreConfigSkeleton::ItemLongLong( d->mCurrentGroup, key.isNull() ? name : key,
1193  reference, defaultValue );
1194  addItem( item, name );
1195  return item;
1196 }
1197 
1198 #ifndef KDE_NO_DEPRECATED
1199 KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemInt64(
1200  const QString& name,
1201  qint64 &reference,
1202  qint64 defaultValue,
1203  const QString & key)
1204 {
1205  return addItemLongLong(name, reference, defaultValue, key);
1206 }
1207 #endif
1208 
1209 KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemULongLong( const QString &name, quint64 &reference,
1210  quint64 defaultValue, const QString &key )
1211 {
1212  KCoreConfigSkeleton::ItemULongLong *item;
1213  item = new KCoreConfigSkeleton::ItemULongLong( d->mCurrentGroup, key.isNull() ? name : key,
1214  reference, defaultValue );
1215  addItem( item, name );
1216  return item;
1217 }
1218 
1219 #ifndef KDE_NO_DEPRECATED
1220 KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemUInt64(
1221  const QString & name,
1222  quint64 &reference,
1223  quint64 defaultValue,
1224  const QString & key)
1225 {
1226  return addItemULongLong(name, reference, defaultValue, key);
1227 }
1228 #endif
1229 
1230 KCoreConfigSkeleton::ItemDouble *KCoreConfigSkeleton::addItemDouble( const QString &name, double &reference,
1231  double defaultValue, const QString &key )
1232 {
1233  KCoreConfigSkeleton::ItemDouble *item;
1234  item = new KCoreConfigSkeleton::ItemDouble( d->mCurrentGroup, key.isNull() ? name : key,
1235  reference, defaultValue );
1236  addItem( item, name );
1237  return item;
1238 }
1239 
1240 KCoreConfigSkeleton::ItemRect *KCoreConfigSkeleton::addItemRect( const QString &name, QRect &reference,
1241  const QRect &defaultValue, const QString &key )
1242 {
1243  KCoreConfigSkeleton::ItemRect *item;
1244  item = new KCoreConfigSkeleton::ItemRect( d->mCurrentGroup, key.isNull() ? name : key,
1245  reference, defaultValue );
1246  addItem( item, name );
1247  return item;
1248 }
1249 
1250 KCoreConfigSkeleton::ItemPoint *KCoreConfigSkeleton::addItemPoint( const QString &name, QPoint &reference,
1251  const QPoint &defaultValue, const QString &key )
1252 {
1253  KCoreConfigSkeleton::ItemPoint *item;
1254  item = new KCoreConfigSkeleton::ItemPoint( d->mCurrentGroup, key.isNull() ? name : key,
1255  reference, defaultValue );
1256  addItem( item, name );
1257  return item;
1258 }
1259 
1260 KCoreConfigSkeleton::ItemSize *KCoreConfigSkeleton::addItemSize( const QString &name, QSize &reference,
1261  const QSize &defaultValue, const QString &key )
1262 {
1263  KCoreConfigSkeleton::ItemSize *item;
1264  item = new KCoreConfigSkeleton::ItemSize( d->mCurrentGroup, key.isNull() ? name : key,
1265  reference, defaultValue );
1266  addItem( item, name );
1267  return item;
1268 }
1269 
1270 KCoreConfigSkeleton::ItemDateTime *KCoreConfigSkeleton::addItemDateTime( const QString &name, QDateTime &reference,
1271  const QDateTime &defaultValue, const QString &key )
1272 {
1273  KCoreConfigSkeleton::ItemDateTime *item;
1274  item = new KCoreConfigSkeleton::ItemDateTime( d->mCurrentGroup, key.isNull() ? name : key,
1275  reference, defaultValue );
1276  addItem( item, name );
1277  return item;
1278 }
1279 
1280 KCoreConfigSkeleton::ItemStringList *KCoreConfigSkeleton::addItemStringList( const QString &name, QStringList &reference,
1281  const QStringList &defaultValue, const QString &key )
1282 {
1283  KCoreConfigSkeleton::ItemStringList *item;
1284  item = new KCoreConfigSkeleton::ItemStringList( d->mCurrentGroup, key.isNull() ? name : key,
1285  reference, defaultValue );
1286  addItem( item, name );
1287  return item;
1288 }
1289 
1290 KCoreConfigSkeleton::ItemIntList *KCoreConfigSkeleton::addItemIntList( const QString &name, QList<int> &reference,
1291  const QList<int> &defaultValue, const QString &key )
1292 {
1293  KCoreConfigSkeleton::ItemIntList *item;
1294  item = new KCoreConfigSkeleton::ItemIntList( d->mCurrentGroup, key.isNull() ? name : key,
1295  reference, defaultValue );
1296  addItem( item, name );
1297  return item;
1298 }
1299 
1300 bool KCoreConfigSkeleton::isImmutable(const QString &name)
1301 {
1302  return const_cast<const KCoreConfigSkeleton*>(this)->isImmutable(name);
1303 }
1304 
1305 bool KCoreConfigSkeleton::isImmutable(const QString &name) const
1306 {
1307  KConfigSkeletonItem *item = findItem(name);
1308  return !item || item->isImmutable();
1309 }
1310 
1311 KConfigSkeletonItem *KCoreConfigSkeleton::findItem(const QString &name)
1312 {
1313  return const_cast<const KCoreConfigSkeleton*>(this)->findItem(name);
1314 }
1315 
1316 KConfigSkeletonItem *KCoreConfigSkeleton::findItem(const QString &name) const
1317 {
1318  return d->mItemDict.value(name);
1319 }
1320 
1321 #include "kcoreconfigskeleton.moc"
1322 
KCoreConfigSkeleton::ItemInt::maxValue
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:352
KCoreConfigSkeleton::ItemULongLong
Class for handling unsigned 64-bit integer preferences item.
Definition: kcoreconfigskeleton.h:698
QVariant::toLongLong
qlonglong toLongLong(bool *ok) const
KCoreConfigSkeleton::findItem
KConfigSkeletonItem * findItem(const QString &name)
Lookup item by name.
Definition: kcoreconfigskeleton.cpp:1311
KConfigGroup::readPathEntry
QString readPathEntry(const QString &pKey, const QString &aDefault) const
Reads a path.
Definition: kconfiggroup.cpp:780
KSharedPtr< KSharedConfig >
KCoreConfigSkeleton::ItemEnum::readConfig
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
KConfig::sync
void sync()
Definition: kconfig.cpp:388
KCoreConfigSkeleton::config
KConfig * config()
Return the KConfig object used for reading and writing the settings.
Definition: kcoreconfigskeleton.cpp:1018
KCoreConfigSkeleton::ItemPoint::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:751
KCoreConfigSkeleton::ItemInt::ItemInt
ItemInt(const QString &_group, const QString &_key, qint32 &reference, qint32 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:310
KConfigSkeletonGenericItem
Definition: kcoreconfigskeleton.h:217
qint64
KCoreConfigSkeleton::ItemUrl::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:241
KConfigSkeletonItemPrivate
Definition: kcoreconfigskeleton_p.h:51
QHash::insert
iterator insert(const Key &key, const T &value)
KCoreConfigSkeleton::addItemSize
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
KCoreConfigSkeleton::ItemLongLong::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:402
KConfigGroup::writePathEntry
void writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags=Normal)
Writes a file path to the configuration.
Definition: kconfiggroup.cpp:1074
KCoreConfigSkeleton::ItemRect::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:724
kdebug.h
KCoreConfigSkeleton::ItemInt::readConfig
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
KCoreConfigSkeleton::ItemInt::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:335
KSharedPtr::data
T * data()
Definition: ksharedptr.h:111
KCoreConfigSkeleton::ItemDouble
Class for handling a floating point preference item.
Definition: kcoreconfigskeleton.h:742
KCoreConfigSkeleton::Private::mUseDefaults
bool mUseDefaults
Definition: kcoreconfigskeleton_p.h:48
KCoreConfigSkeleton::ItemString
Class for handling a string preferences item.
Definition: kcoreconfigskeleton.h:373
KConfigSkeletonItemPrivate::mLabel
QString mLabel
The label for this item.
Definition: kcoreconfigskeleton_p.h:59
KConfigSkeletonItem::group
QString group() const
Return config file group.
Definition: kcoreconfigskeleton.cpp:48
KCoreConfigSkeleton::readConfig
virtual void readConfig()
Read preferences from config file.
Definition: kcoreconfigskeleton.cpp:1062
KCoreConfigSkeleton::ItemUInt::setMaxValue
void setMaxValue(quint32)
Set the maximum value for the item.
Definition: kcoreconfigskeleton.cpp:568
KMacroExpander::group
Definition: kmacroexpander_unix.cpp:34
KCoreConfigSkeleton::ItemUrlList::readConfig
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
KCoreConfigSkeleton::ItemUInt::maxValue
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:555
KCoreConfigSkeleton::ItemStringList::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:855
KConfigSkeletonItem::readDefault
virtual void readDefault(KConfig *)=0
Read global default value.
KCoreConfigSkeleton::writeConfig
virtual void writeConfig()
Write preferences to config file.
Definition: kcoreconfigskeleton.cpp:1074
KCoreConfigSkeleton::ItemEnum::Choice::label
QString label
Definition: kcoreconfigskeleton.h:616
KConfigGroup::hasDefault
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
KCoreConfigSkeleton::ItemUrlList::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:930
QVariant::toDateTime
QDateTime toDateTime() const
KCoreConfigSkeleton::ItemBool::readConfig
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
KCoreConfigSkeleton::ItemPathList::ItemPathList
ItemPathList(const QString &_group, const QString &_key, QStringList &reference, const QStringList &defaultValue=QStringList())
Constructor.
Definition: kcoreconfigskeleton.cpp:861
KCoreConfigSkeleton::addItemInt64
ItemLongLong * addItemInt64(const QString &name, qint64 &reference, qint64 defaultValue=0, const QString &key=QString())
Definition: kcoreconfigskeleton.cpp:1199
KConfigSkeletonItem::isImmutable
bool isImmutable() const
Return if the entry can be modified.
Definition: kcoreconfigskeleton.cpp:113
KConfigSkeletonItemPrivate::mIsImmutable
bool mIsImmutable
Indicates this item is immutable.
Definition: kcoreconfigskeleton_p.h:57
KCoreConfigSkeleton::ItemEnum::Choice
Definition: kcoreconfigskeleton.h:613
KCoreConfigSkeleton::ItemULongLong::minValue
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:610
KConfigGroup::isEntryImmutable
bool isEntryImmutable(const QString &key) const
Checks if it is possible to change the given entry.
Definition: kconfiggroup.cpp:632
KCoreConfigSkeleton::ItemString::Normal
A normal string.
Definition: kcoreconfigskeleton.h:376
KCoreConfigSkeleton::ItemEnum::ItemEnum
ItemEnum(const QString &_group, const QString &_key, qint32 &reference, const QList< Choice > &choices, qint32 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:433
KCoreConfigSkeleton::ItemPoint::ItemPoint
ItemPoint(const QString &_group, const QString &_key, QPoint &reference, const QPoint &defaultValue=QPoint())
Constructor.
Definition: kcoreconfigskeleton.cpp:730
KCoreConfigSkeleton::Private::mConfig
KSharedConfig::Ptr mConfig
Definition: kcoreconfigskeleton_p.h:43
KCoreConfigSkeleton::setCurrentGroup
void setCurrentGroup(const QString &group)
Set the config file group for subsequent addItem() calls.
Definition: kcoreconfigskeleton.cpp:1008
KCoreConfigSkeleton::ItemEnum::choices
QList< Choice > choices() const
Definition: kcoreconfigskeleton.cpp:496
KCoreConfigSkeleton::Private::mItems
KConfigSkeletonItem::List mItems
Definition: kcoreconfigskeleton_p.h:45
KCoreConfigSkeleton::ItemLongLong::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:397
KCoreConfigSkeleton::ItemStringList::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:850
KCoreConfigSkeleton::ItemDateTime::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:820
KCoreConfigSkeleton::ItemUInt::minValue
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:548
KCoreConfigSkeleton::ItemUrlList::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:935
KCoreConfigSkeleton::ItemDateTime::ItemDateTime
ItemDateTime(const QString &_group, const QString &_key, QDateTime &reference, const QDateTime &defaultValue=QDateTime())
Constructor.
Definition: kcoreconfigskeleton.cpp:794
KConfigGroup::writeEntry
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
Writes a value to the configuration object.
Definition: kconfiggroup.cpp:1037
KConfigSkeletonItem::toolTip
QString toolTip() const
Return ToolTip description of item.
Definition: kcoreconfigskeleton.cpp:88
KCoreConfigSkeleton::ItemDateTime
Class for handling a QDateTime preferences item.
Definition: kcoreconfigskeleton.h:856
KCoreConfigSkeleton::ItemInt::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:330
KCoreConfigSkeleton::ItemBool::ItemBool
ItemBool(const QString &_group, const QString &_key, bool &reference, bool defaultValue=true)
Constructor.
Definition: kcoreconfigskeleton.cpp:279
KConfig::isDirty
bool isDirty() const
Returns true if sync has any changes to write out.
Definition: kconfig.cpp:469
double
quint32
QPoint
KCoreConfigSkeleton::ItemLongLong
Class for handling a 64-bit integer preferences item.
Definition: kcoreconfigskeleton.h:565
KConfigSkeletonItem::setKey
void setKey(const QString &_key)
Set config file key.
Definition: kcoreconfigskeleton.cpp:53
KCoreConfigSkeleton::Private::mCurrentGroup
QString mCurrentGroup
Definition: kcoreconfigskeleton_p.h:41
KCoreConfigSkeleton::ItemEnum::writeConfig
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
KCoreConfigSkeleton::usrSetDefaults
virtual void usrSetDefaults()
Perform the actual setting of default values.
Definition: kcoreconfigskeleton.cpp:1096
KConfigSkeletonItem::maxValue
virtual QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kcoreconfigskeleton.cpp:108
KCoreConfigSkeleton::ItemInt::minValue
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:345
KConfigSkeletonItemPrivate::mToolTip
QString mToolTip
The ToolTip text for this item.
Definition: kcoreconfigskeleton_p.h:60
KCoreConfigSkeleton::ItemProperty::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:268
QVariant::toULongLong
qulonglong toULongLong(bool *ok) const
KCoreConfigSkeleton::ItemEnum::Choice2::name
QString name
Definition: kcoreconfigskeleton.h:622
KCoreConfigSkeleton::ItemPassword
Class for handling a password preferences item.
Definition: kcoreconfigskeleton.h:422
KCoreConfigSkeleton::configChanged
void configChanged()
This signal is emitted when the configuration change.
KCoreConfigSkeleton::addItemDateTime
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
KUrl
Represents and parses a URL.
Definition: kurl.h:111
KCoreConfigSkeleton::addItemUInt
ItemUInt * addItemUInt(const QString &name, quint32 &reference, quint32 defaultValue=0, const QString &key=QString())
Register an item of type quint32.
Definition: kcoreconfigskeleton.cpp:1178
KCoreConfigSkeleton::ItemULongLong::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:595
KGlobal::config
KSharedConfigPtr config()
Returns the general config object.
Definition: kglobal.cpp:139
QString::isNull
bool isNull() const
KCoreConfigSkeleton::addItemIntList
ItemIntList * addItemIntList(const QString &name, QList< int > &reference, const QList< int > &defaultValue=QList< int >(), const QString &key=QString())
Register an item of type QList.
Definition: kcoreconfigskeleton.cpp:1290
KCoreConfigSkeleton::ItemStringList::ItemStringList
ItemStringList(const QString &_group, const QString &_key, QStringList &reference, const QStringList &defaultValue=QStringList())
Constructor.
Definition: kcoreconfigskeleton.cpp:826
KConfigSkeletonItem::readConfig
virtual void readConfig(KConfig *)=0
This function is called by KCoreConfigSkeleton to read the value for this setting from a config file...
KConfigSkeletonItem::setWhatsThis
void setWhatsThis(const QString &w)
Set WhatsThis description of item.
Definition: kcoreconfigskeleton.cpp:93
KCoreConfigSkeleton::ItemSize::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:778
KCoreConfigSkeleton::ItemProperty
Class for handling a QVariant preferences item.
Definition: kcoreconfigskeleton.h:475
QObject::name
const char * name() const
QRect
KCoreConfigSkeleton::ItemUInt::ItemUInt
ItemUInt(const QString &_group, const QString &_key, quint32 &reference, quint32 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:512
KCoreConfigSkeleton::ItemProperty::ItemProperty
ItemProperty(const QString &_group, const QString &_key, QVariant &reference, const QVariant &defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:246
KCoreConfigSkeleton::ItemEnum::choices2
QList< Choice2 > choices2() const
Definition: kcoreconfigskeleton.cpp:506
kglobal.h
QList::append
void append(const T &value)
KCoreConfigSkeleton::ItemInt::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:340
QVariant::toUInt
uint toUInt(bool *ok) const
KCoreConfigSkeleton::ItemString::writeConfig
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
KCoreConfigSkeleton::ItemBool
Class for handling a bool preferences item.
Definition: kcoreconfigskeleton.h:496
KCoreConfigSkeleton::ItemString::Type
Type
The type of string that is held in this item.
Definition: kcoreconfigskeleton.h:376
QVariant::toInt
int toInt(bool *ok) const
KCoreConfigSkeleton::addItemInt
ItemInt * addItemInt(const QString &name, qint32 &reference, qint32 defaultValue=0, const QString &key=QString())
Register an item of type qint32.
Definition: kcoreconfigskeleton.cpp:1168
KCoreConfigSkeleton::ItemSize::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:783
KCoreConfigSkeleton::ItemUInt
Class for handling an unsigned 32-bit integer preferences item.
Definition: kcoreconfigskeleton.h:657
KCoreConfigSkeleton::ItemPoint::readConfig
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
KCoreConfigSkeleton::ItemDouble::setMaxValue
void setMaxValue(double)
Set the maximum value for the item.
Definition: kcoreconfigskeleton.cpp:691
KCoreConfigSkeleton::ItemLongLong::maxValue
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:414
KCoreConfigSkeleton::ItemUrl::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:236
QObject
KCoreConfigSkeleton
Class for handling preferences settings for an application.
Definition: kcoreconfigskeleton.h:366
KConfigSkeletonItem::label
QString label() const
Return label of item.
Definition: kcoreconfigskeleton.cpp:78
KConfigSkeletonItem::setToolTip
void setToolTip(const QString &t)
Set ToolTip description of item.
Definition: kcoreconfigskeleton.cpp:83
KCoreConfigSkeleton::ItemString::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:183
KCoreConfigSkeleton::ItemPathList::readConfig
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
KCoreConfigSkeleton::ItemPoint::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:756
KCoreConfigSkeleton::ItemULongLong::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:600
QString::isEmpty
bool isEmpty() const
KCoreConfigSkeleton::ItemUrlList::ItemUrlList
ItemUrlList(const QString &_group, const QString &_key, KUrl::List &reference, const KUrl::List &defaultValue=KUrl::List())
Constructor.
Definition: kcoreconfigskeleton.cpp:894
KConfigSkeletonItem::setLabel
void setLabel(const QString &l)
Set label providing a translated one-line description of the item.
Definition: kcoreconfigskeleton.cpp:73
KCoreConfigSkeleton::ItemDouble::setMinValue
void setMinValue(double)
Set the minimum value for the item.
Definition: kcoreconfigskeleton.cpp:685
KCoreConfigSkeleton::ItemIntList::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:966
KCoreConfigSkeleton::ItemUInt::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:538
KDebug::registerArea
static int registerArea(const QByteArray &areaName, bool enabled=true)
Definition: kdebug.cpp:856
KCoreConfigSkeleton::addItemBool
ItemBool * addItemBool(const QString &name, bool &reference, bool defaultValue=false, const QString &key=QString())
Register an item of type bool.
Definition: kcoreconfigskeleton.cpp:1158
KCoreConfigSkeleton::addItemPath
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
KCoreConfigSkeleton::KCoreConfigSkeleton
KCoreConfigSkeleton(const QString &configname=QString(), QObject *parent=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:978
KCoreConfigSkeleton::ItemIntList::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:971
KCoreConfigSkeleton::addItemULongLong
ItemULongLong * addItemULongLong(const QString &name, quint64 &reference, quint64 defaultValue=0, const QString &key=QString())
Register an item of type quint64.
Definition: kcoreconfigskeleton.cpp:1209
KCoreConfigSkeleton::ItemUrlList::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:925
KCoreConfigSkeleton::ItemRect::readConfig
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
KCoreConfigSkeleton::ItemEnum::Choice2::label
QString label
Definition: kcoreconfigskeleton.h:623
KCoreConfigSkeleton::ItemDouble::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:661
KCoreConfigSkeleton::usrReadConfig
virtual void usrReadConfig()
Perform the actual reading of the configuration file.
Definition: kcoreconfigskeleton.cpp:1100
KCoreConfigSkeleton::usrWriteConfig
virtual void usrWriteConfig()
Perform the actual writing of the configuration file.
Definition: kcoreconfigskeleton.cpp:1104
KCoreConfigSkeleton::ItemProperty::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:263
KCoreConfigSkeleton::ItemInt::setMinValue
void setMinValue(qint32)
Set the minimum value for the item.
Definition: kcoreconfigskeleton.cpp:359
KCoreConfigSkeleton::ItemDouble::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:656
KCoreConfigSkeleton::ItemPoint::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:746
QString
KCoreConfigSkeleton::ItemUInt::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:543
QList< Choice >
KCoreConfigSkeleton::ItemProperty::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:274
KCoreConfigSkeleton::ItemULongLong::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:605
KCoreConfigSkeleton::ItemIntList::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:961
KCoreConfigSkeleton::ItemProperty::readConfig
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
KConfigSkeletonItem::name
QString name() const
Return internal name of entry.
Definition: kcoreconfigskeleton.cpp:68
kcoreconfigskeleton_p.h
KCoreConfigSkeleton::ItemUrl::writeConfig
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
KCoreConfigSkeleton::ItemIntList::readConfig
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
KCoreConfigSkeleton::addItemLongLong
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::ItemRect
Class for handling a QRect preferences item.
Definition: kcoreconfigskeleton.h:784
QStringList
KCoreConfigSkeleton::addItemStringList
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
QVariant::toSize
QSize toSize() const
KCoreConfigSkeleton::ItemRect::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:714
KCoreConfigSkeleton::ItemSize::readConfig
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
KCoreConfigSkeleton::ItemDouble::ItemDouble
ItemDouble(const QString &_group, const QString &_key, double &reference, double defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:636
kcoreconfigskeleton.h
KCoreConfigSkeleton::ItemLongLong::setMinValue
void setMinValue(qint64)
Set the minimum value for the item.
Definition: kcoreconfigskeleton.cpp:421
QHash::value
const T value(const Key &key) const
KCoreConfigSkeleton::ItemPassword::ItemPassword
ItemPassword(const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QLatin1String(""))
Constructor.
Definition: kcoreconfigskeleton.cpp:188
QSize
KCoreConfigSkeleton::ItemUrl::ItemUrl
ItemUrl(const QString &_group, const QString &_key, KUrl &reference, const KUrl &defaultValue=KUrl())
Constructor.
Definition: kcoreconfigskeleton.cpp:202
KConfigSkeletonItem::key
QString key() const
Return config file key.
Definition: kcoreconfigskeleton.cpp:58
KCoreConfigSkeleton::ItemDouble::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:666
KCoreConfigSkeleton::addItemRect
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
KCoreConfigSkeleton::ItemString::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:178
KConfigSkeletonItem::KConfigSkeletonItem
KConfigSkeletonItem(const QString &_group, const QString &_key)
Constructor.
Definition: kcoreconfigskeleton.cpp:30
KConfigSkeletonItem::mName
QString mName
The name of this item.
Definition: kcoreconfigskeleton.h:207
KCoreConfigSkeleton::Private
Definition: kcoreconfigskeleton_p.h:27
kstringhandler.h
KCoreConfigSkeleton::ItemInt
Class for handling a 32-bit integer preferences item.
Definition: kcoreconfigskeleton.h:520
KCoreConfigSkeleton::ItemEnum::Choice2
Definition: kcoreconfigskeleton.h:620
KConfigGroup::hasKey
bool hasKey(const QString &key) const
Checks whether the key has an entry in this group.
Definition: kconfiggroup.cpp:1155
KCoreConfigSkeleton::addItemPoint
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
KCoreConfigSkeleton::ItemDateTime::readConfig
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
KCoreConfigSkeleton::ItemULongLong::setMinValue
void setMinValue(quint64)
Set the minimum value for the item.
Definition: kcoreconfigskeleton.cpp:624
KConfigGroup
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:53
KCoreConfigSkeleton::addItemUInt64
ItemULongLong * addItemUInt64(const QString &name, quint64 &reference, quint64 defaultValue=0, const QString &key=QString())
Definition: kcoreconfigskeleton.cpp:1220
KCoreConfigSkeleton::ItemUInt::setMinValue
void setMinValue(quint32)
Set the minimum value for the item.
Definition: kcoreconfigskeleton.cpp:562
KCoreConfigSkeleton::ItemLongLong::ItemLongLong
ItemLongLong(const QString &_group, const QString &_key, qint64 &reference, qint64 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:372
KUrl::List
KUrl::List is a QList that contains KUrls with a few convenience methods.
Definition: kurl.h:146
KCoreConfigSkeleton::ItemPoint
Class for handling a QPoint preferences item.
Definition: kcoreconfigskeleton.h:808
KConfig
The central class of the KDE configuration data system.
Definition: kconfig.h:70
KConfigSkeletonItem::readImmutability
void readImmutability(const KConfigGroup &group)
sets mIsImmutable to true if mKey in config is immutable
Definition: kcoreconfigskeleton.cpp:118
KCoreConfigSkeleton::ItemStringList::readConfig
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
KCoreConfigSkeleton::ItemDateTime::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:815
KCoreConfigSkeleton::ItemDouble::minValue
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:671
KCoreConfigSkeleton::Private::mItemDict
KConfigSkeletonItem::Dict mItemDict
Definition: kcoreconfigskeleton_p.h:46
QVariant::toStringList
QStringList toStringList() const
KCoreConfigSkeleton::ItemULongLong::maxValue
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:617
KCoreConfigSkeleton::setSharedConfig
void setSharedConfig(KSharedConfig::Ptr pConfig)
Set the KSharedConfig object used for reading and writing the settings.
Definition: kcoreconfigskeleton.cpp:1028
KCoreConfigSkeleton::ItemLongLong::setMaxValue
void setMaxValue(qint64)
Set the maximum value for the item.
Definition: kcoreconfigskeleton.cpp:427
KCoreConfigSkeleton::ItemSize
Class for handling a QSize preferences item.
Definition: kcoreconfigskeleton.h:832
KCoreConfigSkeleton::setDefaults
virtual void setDefaults()
Set all registered items to their default values.
Definition: kcoreconfigskeleton.cpp:1053
KCoreConfigSkeleton::ItemDouble::readConfig
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
KCoreConfigSkeleton::ItemRect::ItemRect
ItemRect(const QString &_group, const QString &_key, QRect &reference, const QRect &defaultValue=QRect())
Constructor.
Definition: kcoreconfigskeleton.cpp:698
KCoreConfigSkeleton::ItemPath::ItemPath
ItemPath(const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QString())
Constructor.
Definition: kcoreconfigskeleton.cpp:195
kstandarddirs.h
quint64
KCoreConfigSkeleton::addItemDouble
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
KCoreConfigSkeleton::ItemLongLong::readConfig
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
KConfig::reparseConfiguration
void reparseConfiguration()
Updates the state of this object to match the persistent storage.
Definition: kconfig.cpp:557
KConfigSkeletonItem::mKey
QString mKey
The config key for this item.
Definition: kcoreconfigskeleton.h:206
KCoreConfigSkeleton::ItemULongLong::ItemULongLong
ItemULongLong(const QString &_group, const QString &_key, quint64 &reference, quint64 defaultValue=0)
Constructor.
Definition: kcoreconfigskeleton.cpp:575
KCoreConfigSkeleton::addItem
void addItem(KConfigSkeletonItem *, const QString &name=QString())
Register a custom KConfigSkeletonItem with a given name.
Definition: kcoreconfigskeleton.cpp:1108
KCoreConfigSkeleton::addItemPassword
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
QList< KConfigSkeletonItem * >::ConstIterator
typedef ConstIterator
KCoreConfigSkeleton::ItemBool::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:299
KConfigSkeletonItem::setName
void setName(const QString &_name)
Set internal name of entry.
Definition: kcoreconfigskeleton.cpp:63
KConfigSkeletonItem::whatsThis
QString whatsThis() const
Return WhatsThis description of item.
Definition: kcoreconfigskeleton.cpp:98
KCoreConfigSkeleton::isImmutable
bool isImmutable(const QString &name)
Return whether a certain item is immutable.
Definition: kcoreconfigskeleton.cpp:1300
kCoreConfigSkeletionDebugArea
static int kCoreConfigSkeletionDebugArea()
Definition: kcoreconfigskeleton.cpp:976
KCoreConfigSkeleton::ItemBool::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:294
bool
KCoreConfigSkeleton::addItemString
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
KCoreConfigSkeleton::ItemInt::setMaxValue
void setMaxValue(qint32)
Set the maximum value for the item.
Definition: kcoreconfigskeleton.cpp:365
KCoreConfigSkeleton::ItemSize::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:788
QVariant::toBool
bool toBool() const
KCoreConfigSkeleton::ItemDateTime::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:810
Kuit::Tag::List
Definition: kuitsemantics.cpp:84
qint32
KCoreConfigSkeleton::ItemULongLong::readConfig
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
KCoreConfigSkeleton::ItemStringList
Class for handling a string list preferences item.
Definition: kcoreconfigskeleton.h:881
KCoreConfigSkeleton::ItemString::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:173
QVariant::toPoint
QPoint toPoint() const
KCoreConfigSkeleton::ItemUrl::readConfig
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
kDebug
#define kDebug
Definition: kdebug.h:316
QVariant::toDouble
double toDouble(bool *ok) const
KCoreConfigSkeleton::ItemString::readConfig
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
KCoreConfigSkeleton::ItemPathList::writeConfig
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
KConfigSkeletonItem
Class for storing a preferences setting.
Definition: kcoreconfigskeleton.h:52
KCoreConfigSkeleton::~KCoreConfigSkeleton
virtual ~KCoreConfigSkeleton()
Destructor.
Definition: kcoreconfigskeleton.cpp:1003
KCoreConfigSkeleton::ItemStringList::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:845
KCoreConfigSkeleton::ItemUrlList::writeConfig
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
KConfigSkeletonItem::mGroup
QString mGroup
The group name for this item.
Definition: kcoreconfigskeleton.h:205
QVariant::toRect
QRect toRect() const
QList::constEnd
const_iterator constEnd() const
QList::constBegin
const_iterator constBegin() const
KSharedConfig::openConfig
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
Creates a KSharedConfig object to manipulate a configuration file.
Definition: ksharedconfig.cpp:31
KConfigSkeletonItem::~KConfigSkeletonItem
virtual ~KConfigSkeletonItem()
Destructor.
Definition: kcoreconfigskeleton.cpp:38
KCoreConfigSkeleton::ItemUrl::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:231
QObject::parent
QObject * parent() const
KCoreConfigSkeleton::ItemIntList
Class for handling an integer list preferences item.
Definition: kcoreconfigskeleton.h:950
KCoreConfigSkeleton::ItemUInt::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:533
KCoreConfigSkeleton::ItemEnum::Choice::name
QString name
Definition: kcoreconfigskeleton.h:615
KConfigSkeletonItem::setGroup
void setGroup(const QString &_group)
Set config file group.
Definition: kcoreconfigskeleton.cpp:43
KStringHandler::obscure
QString obscure(const QString &str)
Obscure string by using a simple symmetric encryption.
Definition: kstringhandler.cpp:190
QVariant::toString
QString toString() const
KCoreConfigSkeleton::ItemEnum::Choice::whatsThis
QString whatsThis
Definition: kcoreconfigskeleton.h:617
KCoreConfigSkeleton::currentGroup
QString currentGroup() const
Returns the current group used for addItem() calls.
Definition: kcoreconfigskeleton.cpp:1013
KCoreConfigSkeleton::ItemLongLong::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kcoreconfigskeleton.cpp:392
KConfigGroup::readEntry
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
KCoreConfigSkeleton::ItemDouble::maxValue
QVariant maxValue() const
Get the maximum value this is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:678
KCoreConfigSkeleton::usrUseDefaults
virtual bool usrUseDefaults(bool b)
Implemented by subclasses that use special defaults.
Definition: kcoreconfigskeleton.cpp:1091
KConfigGroup::revertToDefault
void revertToDefault(const QString &key)
Reverts an entry to the default settings.
Definition: kconfiggroup.cpp:1125
KCoreConfigSkeleton::ItemBool::property
QVariant property() const
Return item as property.
Definition: kcoreconfigskeleton.cpp:304
KCoreConfigSkeleton::ItemULongLong::setMaxValue
void setMaxValue(quint64)
Set the maximum value for the item.
Definition: kcoreconfigskeleton.cpp:630
KCoreConfigSkeleton::items
KConfigSkeletonItem::List items() const
Return list of items managed by this KCoreConfigSkeleton object.
Definition: kcoreconfigskeleton.cpp:1033
KCoreConfigSkeleton::ItemUInt::readConfig
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
KConfigSkeletonItemPrivate::mWhatsThis
QString mWhatsThis
The What's This text for this item.
Definition: kcoreconfigskeleton_p.h:61
QDateTime
KCoreConfigSkeleton::ItemRect::isEqual
bool isEqual(const QVariant &p) const
Check whether the item is equal to p.
Definition: kcoreconfigskeleton.cpp:719
KCoreConfigSkeleton::ItemSize::ItemSize
ItemSize(const QString &_group, const QString &_key, QSize &reference, const QSize &defaultValue=QSize())
Constructor.
Definition: kcoreconfigskeleton.cpp:762
KCoreConfigSkeleton::ItemPath
Class for handling a path preferences item.
Definition: kcoreconfigskeleton.h:434
KCoreConfigSkeleton::addItemProperty
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
defaultValue
QString defaultValue(const QString &t)
Definition: kconfig_compiler.cpp:950
KConfigSkeletonItem::minValue
virtual QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kcoreconfigskeleton.cpp:103
KCoreConfigSkeleton::ItemEnum::Choice2::whatsThis
QString whatsThis
Definition: kcoreconfigskeleton.h:625
QVariant
KCoreConfigSkeleton::ItemLongLong::minValue
QVariant minValue() const
Get the minimum value that is allowed to be stored in this item.
Definition: kcoreconfigskeleton.cpp:407
KCoreConfigSkeleton::ItemString::ItemString
ItemString(const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QLatin1String(""), Type type=Normal)
Constructor.
Definition: kcoreconfigskeleton.cpp:124
KCoreConfigSkeleton::useDefaults
virtual bool useDefaults(bool b)
Specify whether this object should reflect the actual values or the default values.
Definition: kcoreconfigskeleton.cpp:1038
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal