kconfigskeleton.cpp
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
Copyright (c) 2003 Waldo Bastian <bastian@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <qcolor.h>
#include <qvariant.h>
#include <kconfig.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kdebug.h>
#include "kstringhandler.h"
#include "kconfigskeleton.h"
void KConfigSkeletonItem::readImmutability( KConfig *config )
{
mIsImmutable = config->entryIsImmutable( mKey );
}
KConfigSkeleton::ItemString::ItemString( const QString &group, const QString &key,
QString &reference,
const QString &defaultValue,
Type type )
: KConfigSkeletonGenericItem<QString>( group, key, reference, defaultValue ),
mType( type )
{
}
void KConfigSkeleton::ItemString::writeConfig( KConfig *config )
{
if ( mReference != mLoadedValue ) // WABA: Is this test needed?
{
config->setGroup( mGroup );
if ((mDefault == mReference) && !config->hasDefault( mKey))
config->revertToDefault( mKey );
else if ( mType == Path )
config->writePathEntry( mKey, mReference );
else if ( mType == Password )
config->writeEntry( mKey, KStringHandler::obscure( mReference ) );
else
config->writeEntry( mKey, mReference );
}
}
void KConfigSkeleton::ItemString::readConfig( KConfig *config )
{
config->setGroup( mGroup );
if ( mType == Path )
{
mReference = config->readPathEntry( mKey, mDefault );
}
else if ( mType == Password )
{
QString value = config->readEntry( mKey,
KStringHandler::obscure( mDefault ) );
mReference = KStringHandler::obscure( value );
}
else
{
mReference = config->readEntry( mKey, mDefault );
}
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemString::setProperty(const QVariant & p)
{
mReference = p.toString();
}
QVariant KConfigSkeleton::ItemString::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemPassword::ItemPassword( const QString &group, const QString &key,
QString &reference,
const QString &defaultValue)
: ItemString( group, key, reference, defaultValue, Password )
{
}
KConfigSkeleton::ItemPath::ItemPath( const QString &group, const QString &key,
QString &reference,
const QString &defaultValue)
: ItemString( group, key, reference, defaultValue, Path )
{
}
KConfigSkeleton::ItemProperty::ItemProperty( const QString &group,
const QString &key,
QVariant &reference,
QVariant defaultValue )
: KConfigSkeletonGenericItem<QVariant>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemProperty::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readPropertyEntry( mKey, mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemProperty::setProperty(const QVariant & p)
{
mReference = p;
}
QVariant KConfigSkeleton::ItemProperty::property() const
{
return mReference;
}
KConfigSkeleton::ItemBool::ItemBool( const QString &group, const QString &key,
bool &reference, bool defaultValue )
: KConfigSkeletonGenericItem<bool>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemBool::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readBoolEntry( mKey, mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemBool::setProperty(const QVariant & p)
{
mReference = p.toBool();
}
QVariant KConfigSkeleton::ItemBool::property() const
{
return QVariant( mReference, 42 /* dummy */ );
}
KConfigSkeleton::ItemInt::ItemInt( const QString &group, const QString &key,
int &reference, int defaultValue )
: KConfigSkeletonGenericItem<int>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemInt::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readNumEntry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemInt::setProperty(const QVariant & p)
{
mReference = p.toInt();
}
QVariant KConfigSkeleton::ItemInt::property() const
{
return QVariant(mReference);
}
QVariant KConfigSkeleton::ItemInt::minValue() const
{
if (mHasMin)
return QVariant(mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemInt::maxValue() const
{
if (mHasMax)
return QVariant(mMax);
return QVariant();
}
void KConfigSkeleton::ItemInt::setMinValue(int v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemInt::setMaxValue(int v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemInt64::ItemInt64( const QString &group, const QString &key,
Q_INT64 &reference, Q_INT64 defaultValue )
: KConfigSkeletonGenericItem<Q_INT64>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemInt64::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readNum64Entry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemInt64::setProperty(const QVariant & p)
{
mReference = p.toLongLong();
}
QVariant KConfigSkeleton::ItemInt64::property() const
{
return QVariant(mReference);
}
QVariant KConfigSkeleton::ItemInt64::minValue() const
{
if (mHasMin)
return QVariant(mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemInt64::maxValue() const
{
if (mHasMax)
return QVariant(mMax);
return QVariant();
}
void KConfigSkeleton::ItemInt64::setMinValue(Q_INT64 v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemInt64::setMaxValue(Q_INT64 v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemEnum::ItemEnum( const QString &group, const QString &key,
int &reference,
const QValueList<Choice> &choices,
int defaultValue )
: ItemInt( group, key, reference, defaultValue ), mChoices( choices )
{
}
void KConfigSkeleton::ItemEnum::readConfig( KConfig *config )
{
config->setGroup( mGroup );
if (!config->hasKey(mKey))
{
mReference = mDefault;
}
else
{
int i = 0;
mReference = -1;
QString tmp = config->readEntry( mKey ).lower();
for(QValueList<Choice>::ConstIterator it = mChoices.begin();
it != mChoices.end(); ++it, ++i)
{
if ((*it).name.lower() == tmp)
{
mReference = i;
break;
}
}
if (mReference == -1)
mReference = config->readNumEntry( mKey, mDefault );
}
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemEnum::writeConfig( KConfig *config )
{
if ( mReference != mLoadedValue ) // WABA: Is this test needed?
{
config->setGroup( mGroup );
if ((mDefault == mReference) && !config->hasDefault( mKey))
config->revertToDefault( mKey );
else if ((mReference >= 0) && (mReference < (int) mChoices.count()))
config->writeEntry( mKey, mChoices[mReference].name );
else
config->writeEntry( mKey, mReference );
}
}
QValueList<KConfigSkeleton::ItemEnum::Choice> KConfigSkeleton::ItemEnum::choices() const
{
return mChoices;
}
KConfigSkeleton::ItemUInt::ItemUInt( const QString &group, const QString &key,
unsigned int &reference,
unsigned int defaultValue )
: KConfigSkeletonGenericItem<unsigned int>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemUInt::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readUnsignedNumEntry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemUInt::setProperty(const QVariant & p)
{
mReference = p.toUInt();
}
QVariant KConfigSkeleton::ItemUInt::property() const
{
return QVariant(mReference);
}
QVariant KConfigSkeleton::ItemUInt::minValue() const
{
if (mHasMin)
return QVariant(mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemUInt::maxValue() const
{
if (mHasMax)
return QVariant(mMax);
return QVariant();
}
void KConfigSkeleton::ItemUInt::setMinValue(unsigned int v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemUInt::setMaxValue(unsigned int v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemUInt64::ItemUInt64( const QString &group, const QString &key,
Q_UINT64 &reference, Q_UINT64 defaultValue )
: KConfigSkeletonGenericItem<Q_UINT64>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemUInt64::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readUnsignedNum64Entry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemUInt64::setProperty(const QVariant & p)
{
mReference = p.toULongLong();
}
QVariant KConfigSkeleton::ItemUInt64::property() const
{
return QVariant(mReference);
}
QVariant KConfigSkeleton::ItemUInt64::minValue() const
{
if (mHasMin)
return QVariant(mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemUInt64::maxValue() const
{
if (mHasMax)
return QVariant(mMax);
return QVariant();
}
void KConfigSkeleton::ItemUInt64::setMinValue(Q_UINT64 v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemUInt64::setMaxValue(Q_UINT64 v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemLong::ItemLong( const QString &group, const QString &key,
long &reference, long defaultValue )
: KConfigSkeletonGenericItem<long>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemLong::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readLongNumEntry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemLong::setProperty(const QVariant & p)
{
mReference = p.toLongLong();
}
QVariant KConfigSkeleton::ItemLong::property() const
{
return QVariant((Q_LLONG) mReference);
}
QVariant KConfigSkeleton::ItemLong::minValue() const
{
if (mHasMin)
return QVariant((Q_LLONG) mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemLong::maxValue() const
{
if (mHasMax)
return QVariant((Q_LLONG) mMax);
return QVariant();
}
void KConfigSkeleton::ItemLong::setMinValue(long v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemLong::setMaxValue(long v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemULong::ItemULong( const QString &group, const QString &key,
unsigned long &reference,
unsigned long defaultValue )
: KConfigSkeletonGenericItem<unsigned long>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemULong::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readUnsignedLongNumEntry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemULong::setProperty(const QVariant & p)
{
mReference = p.toULongLong();
}
QVariant KConfigSkeleton::ItemULong::property() const
{
return QVariant((Q_ULLONG) mReference);
}
QVariant KConfigSkeleton::ItemULong::minValue() const
{
if (mHasMin)
return QVariant((Q_ULLONG) mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemULong::maxValue() const
{
if (mHasMax)
return QVariant((Q_ULLONG) mMax);
return QVariant();
}
void KConfigSkeleton::ItemULong::setMinValue(unsigned long v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemULong::setMaxValue(unsigned long v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemDouble::ItemDouble( const QString &group, const QString &key,
double &reference, double defaultValue )
: KConfigSkeletonGenericItem<double>( group, key, reference, defaultValue )
,mHasMin(false), mHasMax(false)
{
}
void KConfigSkeleton::ItemDouble::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readDoubleNumEntry( mKey, mDefault );
if (mHasMin)
mReference = QMAX(mReference, mMin);
if (mHasMax)
mReference = QMIN(mReference, mMax);
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemDouble::setProperty(const QVariant & p)
{
mReference = p.toDouble();
}
QVariant KConfigSkeleton::ItemDouble::property() const
{
return QVariant(mReference);
}
QVariant KConfigSkeleton::ItemDouble::minValue() const
{
if (mHasMin)
return QVariant(mMin);
return QVariant();
}
QVariant KConfigSkeleton::ItemDouble::maxValue() const
{
if (mHasMax)
return QVariant(mMax);
return QVariant();
}
void KConfigSkeleton::ItemDouble::setMinValue(double v)
{
mHasMin = true;
mMin = v;
}
void KConfigSkeleton::ItemDouble::setMaxValue(double v)
{
mHasMax = true;
mMax = v;
}
KConfigSkeleton::ItemColor::ItemColor( const QString &group, const QString &key,
QColor &reference,
const QColor &defaultValue )
: KConfigSkeletonGenericItem<QColor>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemColor::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readColorEntry( mKey, &mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemColor::setProperty(const QVariant & p)
{
mReference = p.toColor();
}
QVariant KConfigSkeleton::ItemColor::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemFont::ItemFont( const QString &group, const QString &key,
QFont &reference,
const QFont &defaultValue )
: KConfigSkeletonGenericItem<QFont>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemFont::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readFontEntry( mKey, &mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemFont::setProperty(const QVariant & p)
{
mReference = p.toFont();
}
QVariant KConfigSkeleton::ItemFont::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemRect::ItemRect( const QString &group, const QString &key,
QRect &reference,
const QRect &defaultValue )
: KConfigSkeletonGenericItem<QRect>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemRect::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readRectEntry( mKey, &mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemRect::setProperty(const QVariant & p)
{
mReference = p.toRect();
}
QVariant KConfigSkeleton::ItemRect::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemPoint::ItemPoint( const QString &group, const QString &key,
QPoint &reference,
const QPoint &defaultValue )
: KConfigSkeletonGenericItem<QPoint>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemPoint::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readPointEntry( mKey, &mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemPoint::setProperty(const QVariant & p)
{
mReference = p.toPoint();
}
QVariant KConfigSkeleton::ItemPoint::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemSize::ItemSize( const QString &group, const QString &key,
QSize &reference,
const QSize &defaultValue )
: KConfigSkeletonGenericItem<QSize>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemSize::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readSizeEntry( mKey, &mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemSize::setProperty(const QVariant & p)
{
mReference = p.toSize();
}
QVariant KConfigSkeleton::ItemSize::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemDateTime::ItemDateTime( const QString &group, const QString &key,
QDateTime &reference,
const QDateTime &defaultValue )
: KConfigSkeletonGenericItem<QDateTime>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemDateTime::readConfig( KConfig *config )
{
config->setGroup( mGroup );
mReference = config->readDateTimeEntry( mKey, &mDefault );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemDateTime::setProperty(const QVariant & p)
{
mReference = p.toDateTime();
}
QVariant KConfigSkeleton::ItemDateTime::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemStringList::ItemStringList( const QString &group, const QString &key,
QStringList &reference,
const QStringList &defaultValue )
: KConfigSkeletonGenericItem<QStringList>( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemStringList::readConfig( KConfig *config )
{
config->setGroup( mGroup );
if ( !config->hasKey( mKey ) )
mReference = mDefault;
else
mReference = config->readListEntry( mKey );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemStringList::setProperty(const QVariant & p)
{
mReference = p.toStringList();
}
QVariant KConfigSkeleton::ItemStringList::property() const
{
return QVariant(mReference);
}
KConfigSkeleton::ItemPathList::ItemPathList( const QString &group, const QString &key,
QStringList &reference,
const QStringList &defaultValue )
: ItemStringList( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemPathList::readConfig( KConfig *config )
{
config->setGroup( mGroup );
if ( !config->hasKey( mKey ) )
mReference = mDefault;
else
mReference = config->readPathListEntry( mKey );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemPathList::writeConfig( KConfig *config )
{
if ( mReference != mLoadedValue ) // WABA: Is this test needed?
{
config->setGroup( mGroup );
if ((mDefault == mReference) && !config->hasDefault( mKey))
config->revertToDefault( mKey );
else {
QStringList sl = mReference;
config->writePathEntry( mKey, sl );
}
}
}
KConfigSkeleton::ItemIntList::ItemIntList( const QString &group, const QString &key,
QValueList<int> &reference,
const QValueList<int> &defaultValue )
: KConfigSkeletonGenericItem<QValueList<int> >( group, key, reference, defaultValue )
{
}
void KConfigSkeleton::ItemIntList::readConfig( KConfig *config )
{
config->setGroup( mGroup );
if ( !config->hasKey( mKey ) )
mReference = mDefault;
else
mReference = config->readIntListEntry( mKey );
mLoadedValue = mReference;
readImmutability( config );
}
void KConfigSkeleton::ItemIntList::setProperty(const QVariant &)
{
// TODO: Not yet supported
}
QVariant KConfigSkeleton::ItemIntList::property() const
{
// TODO: Not yet supported
return QVariant();
}
KConfigSkeleton::KConfigSkeleton( const QString &configname )
: mCurrentGroup( "No Group" ), mUseDefaults(false)
{
kdDebug(177) << "Creating KConfigSkeleton (" << (void *)this << ")" << endl;
if ( !configname.isEmpty() )
{
mConfig = KSharedConfig::openConfig( configname );
}
else
{
mConfig = KGlobal::sharedConfig();
}
}
KConfigSkeleton::KConfigSkeleton(KSharedConfig::Ptr config)
: mCurrentGroup( "No Group" ), mUseDefaults(false)
{
kdDebug(177) << "Creating KConfigSkeleton (" << (void *)this << ")" << endl;
mConfig = config;
}
KConfigSkeleton::~KConfigSkeleton()
{
KConfigSkeletonItem::List::ConstIterator it;
for( it = mItems.begin(); it != mItems.end(); ++it )
{
delete *it;
}
}
void KConfigSkeleton::setCurrentGroup( const QString &group )
{
mCurrentGroup = group;
}
KConfig *KConfigSkeleton::config() const
{
return mConfig;
}
bool KConfigSkeleton::useDefaults(bool b)
{
if (b == mUseDefaults)
return mUseDefaults;
mUseDefaults = b;
KConfigSkeletonItem::List::ConstIterator it;
for( it = mItems.begin(); it != mItems.end(); ++it )
{
(*it)->swapDefault();
}
usrUseDefaults(b);
return !mUseDefaults;
}
void KConfigSkeleton::setDefaults()
{
KConfigSkeletonItem::List::ConstIterator it;
for( it = mItems.begin(); it != mItems.end(); ++it ) {
(*it)->setDefault();
}
usrSetDefaults();
}
void KConfigSkeleton::readConfig()
{
kdDebug(177) << "KConfigSkeleton::readConfig()" << endl;
QString origGroup = mConfig->group();
mConfig->reparseConfiguration();
KConfigSkeletonItem::List::ConstIterator it;
for( it = mItems.begin(); it != mItems.end(); ++it )
{
(*it)->readConfig( mConfig );
}
usrReadConfig();
mConfig->setGroup(origGroup);
}
void KConfigSkeleton::writeConfig()
{
kdDebug(177) << "KConfigSkeleton::writeConfig()" << endl;
QString origGroup = mConfig->group();
KConfigSkeletonItem::List::ConstIterator it;
for( it = mItems.begin(); it != mItems.end(); ++it )
{
(*it)->writeConfig( mConfig );
}
usrWriteConfig();
mConfig->sync();
readConfig();
mConfig->setGroup(origGroup);
}
void KConfigSkeleton::addItem( KConfigSkeletonItem *item, const QString &name )
{
item->setName( name.isEmpty() ? item->key() : name );
mItems.append( item );
mItemDict.insert( item->name(), item );
item->readDefault( mConfig );
item->readConfig( mConfig );
}
KConfigSkeleton::ItemString *KConfigSkeleton::addItemString( const QString &name, QString &reference,
const QString &defaultValue, const QString &key )
{
KConfigSkeleton::ItemString *item;
item = new KConfigSkeleton::ItemString( mCurrentGroup, key.isEmpty() ? name : key,
reference, defaultValue,
KConfigSkeleton::ItemString::Normal );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemPassword *KConfigSkeleton::addItemPassword( const QString &name, QString &reference,
const QString &defaultValue, const QString &key )
{
KConfigSkeleton::ItemPassword *item;
item = new KConfigSkeleton::ItemPassword( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemPath *KConfigSkeleton::addItemPath( const QString &name, QString &reference,
const QString &defaultValue, const QString &key )
{
KConfigSkeleton::ItemPath *item;
item = new KConfigSkeleton::ItemPath( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemProperty *KConfigSkeleton::addItemProperty( const QString &name, QVariant &reference,
const QVariant &defaultValue, const QString &key )
{
KConfigSkeleton::ItemProperty *item;
item = new KConfigSkeleton::ItemProperty( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemBool *KConfigSkeleton::addItemBool( const QString &name, bool &reference,
bool defaultValue, const QString &key )
{
KConfigSkeleton::ItemBool *item;
item = new KConfigSkeleton::ItemBool( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemInt *KConfigSkeleton::addItemInt( const QString &name, int &reference,
int defaultValue, const QString &key )
{
KConfigSkeleton::ItemInt *item;
item = new KConfigSkeleton::ItemInt( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemUInt *KConfigSkeleton::addItemUInt( const QString &name, unsigned int &reference,
unsigned int defaultValue, const QString &key )
{
KConfigSkeleton::ItemUInt *item;
item = new KConfigSkeleton::ItemUInt( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemInt64 *KConfigSkeleton::addItemInt64( const QString &name, Q_INT64 &reference,
Q_INT64 defaultValue, const QString &key )
{
KConfigSkeleton::ItemInt64 *item;
item = new KConfigSkeleton::ItemInt64( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemUInt64 *KConfigSkeleton::addItemUInt64( const QString &name, Q_UINT64 &reference,
Q_UINT64 defaultValue, const QString &key )
{
KConfigSkeleton::ItemUInt64 *item;
item = new KConfigSkeleton::ItemUInt64( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemLong *KConfigSkeleton::addItemLong( const QString &name, long &reference,
long defaultValue, const QString &key )
{
KConfigSkeleton::ItemLong *item;
item = new KConfigSkeleton::ItemLong( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemULong *KConfigSkeleton::addItemULong( const QString &name, unsigned long &reference,
unsigned long defaultValue, const QString &key )
{
KConfigSkeleton::ItemULong *item;
item = new KConfigSkeleton::ItemULong( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemDouble *KConfigSkeleton::addItemDouble( const QString &name, double &reference,
double defaultValue, const QString &key )
{
KConfigSkeleton::ItemDouble *item;
item = new KConfigSkeleton::ItemDouble( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemColor *KConfigSkeleton::addItemColor( const QString &name, QColor &reference,
const QColor &defaultValue, const QString &key )
{
KConfigSkeleton::ItemColor *item;
item = new KConfigSkeleton::ItemColor( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemFont *KConfigSkeleton::addItemFont( const QString &name, QFont &reference,
const QFont &defaultValue, const QString &key )
{
KConfigSkeleton::ItemFont *item;
item = new KConfigSkeleton::ItemFont( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemRect *KConfigSkeleton::addItemRect( const QString &name, QRect &reference,
const QRect &defaultValue, const QString &key )
{
KConfigSkeleton::ItemRect *item;
item = new KConfigSkeleton::ItemRect( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemPoint *KConfigSkeleton::addItemPoint( const QString &name, QPoint &reference,
const QPoint &defaultValue, const QString &key )
{
KConfigSkeleton::ItemPoint *item;
item = new KConfigSkeleton::ItemPoint( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemSize *KConfigSkeleton::addItemSize( const QString &name, QSize &reference,
const QSize &defaultValue, const QString &key )
{
KConfigSkeleton::ItemSize *item;
item = new KConfigSkeleton::ItemSize( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemDateTime *KConfigSkeleton::addItemDateTime( const QString &name, QDateTime &reference,
const QDateTime &defaultValue, const QString &key )
{
KConfigSkeleton::ItemDateTime *item;
item = new KConfigSkeleton::ItemDateTime( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemStringList *KConfigSkeleton::addItemStringList( const QString &name, QStringList &reference,
const QStringList &defaultValue, const QString &key )
{
KConfigSkeleton::ItemStringList *item;
item = new KConfigSkeleton::ItemStringList( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
KConfigSkeleton::ItemIntList *KConfigSkeleton::addItemIntList( const QString &name, QValueList<int> &reference,
const QValueList<int> &defaultValue, const QString &key )
{
KConfigSkeleton::ItemIntList *item;
item = new KConfigSkeleton::ItemIntList( mCurrentGroup, key.isNull() ? name : key,
reference, defaultValue );
addItem( item, name );
return item;
}
bool KConfigSkeleton::isImmutable(const QString &name)
{
KConfigSkeletonItem *item = findItem(name);
return !item || item->isImmutable();
}
KConfigSkeletonItem *KConfigSkeleton::findItem(const QString &name)
{
return mItemDict.find(name);
}
KConfigSkeleton::ItemSize::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:753
KConfigSkeleton::ItemString::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:96
KConfigSkeleton::usrUseDefaults
virtual void usrUseDefaults(bool)
Implemented by subclasses that use special defaults.
Definition: kconfigskeleton.h:1193
KConfigBase::readSizeEntry
QSize readSizeEntry(const QString &pKey, const QSize *pDefault=0L) const
Reads a QSize entry.
Definition: kconfigbase.cpp:889
KSharedPtr< KSharedConfig >
KStringHandler::obscure
static QString obscure(const QString &str)
Obscure string by using a simple symmetric encryption.
Definition: kstringhandler.cpp:556
KConfigBase::readRectEntry
QRect readRectEntry(const QString &pKey, const QRect *pDefault=0L) const
Reads a QRect entry.
Definition: kconfigbase.cpp:840
KConfigBase::readListEntry
int readListEntry(const QString &pKey, QStrList &list, char sep= ',') const
Reads a list of strings.
Definition: kconfigbase.cpp:435
KConfigSkeletonItem::setName
void setName(const QString &name)
Set internal name of entry.
Definition: kconfigskeleton.h:110
KConfigBase::readPointEntry
QPoint readPointEntry(const QString &pKey, const QPoint *pDefault=0L) const
Reads a QPoint entry.
Definition: kconfigbase.cpp:864
KConfigSkeleton::addItemSize
ItemSize * addItemSize(const QString &name, QSize &reference, const QSize &defaultValue=QSize(), const QString &key=QString::null)
Register an item of type QSize.
Definition: kconfigskeleton.cpp:1158
KConfigSkeleton::addItem
void addItem(KConfigSkeletonItem *, const QString &name=QString::null)
Register a custom KConfigSkeletonItem with a given name.
Definition: kconfigskeleton.cpp:988
KConfigSkeleton::ItemStringList::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:793
KConfigSkeleton::ItemULong::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:547
KConfigBase::readDateTimeEntry
QDateTime readDateTimeEntry(const QString &pKey, const QDateTime *pDefault=0L) const
Reads a QDateTime entry.
Definition: kconfigbase.cpp:980
KConfigSkeleton::ItemIntList::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:857
KConfigSkeleton::ItemInt::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:205
KConfigSkeleton::ItemRect
Class for handling a QRect preferences item.
Definition: kconfigskeleton.h:684
KConfigSkeleton::addItemProperty
ItemProperty * addItemProperty(const QString &name, QVariant &reference, const QVariant &defaultValue=QVariant(), const QString &key=QString::null)
Register a property item of type QVariant.
Definition: kconfigskeleton.cpp:1028
KConfigSkeleton::ItemDouble::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:592
KConfigSkeleton::addItemString
ItemString * addItemString(const QString &name, QString &reference, const QString &defaultValue=QString::fromLatin1(""), const QString &key=QString::null)
Register an item of type QString.
Definition: kconfigskeleton.cpp:997
KConfigSkeleton::ItemInt
Class for handling an integer preferences item.
Definition: kconfigskeleton.h:447
KConfigSkeleton::ItemULong
Class for handling an unsigned long integer preferences item.
Definition: kconfigskeleton.h:576
KConfigSkeleton::ItemString::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:67
KConfigSkeleton::ItemULong::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:530
KConfigSkeleton::ItemColor::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:640
KConfigSkeletonItem::readDefault
virtual void readDefault(KConfig *)=0
Read global default value.
KConfigSkeleton::ItemRect::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:699
KConfigSkeleton::ItemLong::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:477
KConfigSkeleton::setCurrentGroup
void setCurrentGroup(const QString &group)
Set the config file group for subsequent addItem() calls.
Definition: kconfigskeleton.cpp:913
KConfigSkeletonItem::isImmutable
bool isImmutable() const
Return if the entry can be modified.
Definition: kconfigskeleton.h:207
KConfigSkeleton::addItemRect
ItemRect * addItemRect(const QString &name, QRect &reference, const QRect &defaultValue=QRect(), const QString &key=QString::null)
Register an item of type QRect.
Definition: kconfigskeleton.cpp:1138
KConfigBase::hasKey
bool hasKey(const QString &key) const
Checks whether the key has an entry in the currently active group.
Definition: kconfigbase.cpp:109
KConfigBase::hasDefault
bool hasDefault(const QString &key) const
Returns whether a default is specified for an entry in either the system wide configuration file or t...
Definition: kconfigbase.cpp:1761
KConfigSkeleton::ItemInt64::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:232
KConfigSkeleton::ItemDouble::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:574
KConfigSkeleton::addItemStringList
ItemStringList * addItemStringList(const QString &name, QStringList &reference, const QStringList &defaultValue=QStringList(), const QString &key=QString::null)
Register an item of type QStringList.
Definition: kconfigskeleton.cpp:1178
KConfigSkeleton::ItemString::writeConfig
void writeConfig(KConfig *config)
This function is called by KConfigSkeleton to write the value of this setting to a config file...
Definition: kconfigskeleton.cpp:50
KConfigBase::readFontEntry
QFont readFontEntry(const QString &pKey, const QFont *pDefault=0L) const
Reads a QFont value.
Definition: kconfigbase.cpp:743
KConfigSkeleton::addItemUInt64
ItemUInt64 * addItemUInt64(const QString &name, Q_UINT64 &reference, Q_UINT64 defaultValue=0, const QString &key=QString::null)
Register an item of type Q_UINT64.
Definition: kconfigskeleton.cpp:1078
KConfigSkeleton::ItemSize::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:739
KConfigSkeleton::ItemDouble::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:604
KConfigSkeleton::setDefaults
void setDefaults()
Set all registered items to their default values.
Definition: kconfigskeleton.cpp:939
KConfigSkeleton::ItemLong::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:472
KConfigSkeleton::addItemLong
ItemLong * addItemLong(const QString &name, long &reference, long defaultValue=0, const QString &key=QString::null)
Register an item of type long.
Definition: kconfigskeleton.cpp:1088
KConfigSkeleton::ItemPathList::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:823
KConfigSkeleton::ItemFont::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:667
KConfigSkeleton::ItemInt64::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:245
KConfigSkeleton::ItemProperty
Class for handling a QVariant preferences item.
Definition: kconfigskeleton.h:417
KConfigBase::readIntListEntry
QValueList< int > readIntListEntry(const QString &pKey) const
Reads a list of Integers.
Definition: kconfigbase.cpp:535
KConfigSkeleton::ItemInt::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:198
KConfigBase::readPropertyEntry
QVariant readPropertyEntry(const QString &pKey, QVariant::Type) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:335
KConfigSkeleton::addItemDateTime
ItemDateTime * addItemDateTime(const QString &name, QDateTime &reference, const QDateTime &defaultValue=QDateTime(), const QString &key=QString::null)
Register an item of type QDateTime.
Definition: kconfigskeleton.cpp:1168
KConfigSkeleton::addItemFont
ItemFont * addItemFont(const QString &name, QFont &reference, const QFont &defaultValue=KGlobalSettings::generalFont(), const QString &key=QString::null)
Register an item of type QFont.
Definition: kconfigskeleton.cpp:1128
KConfigBase::sync
virtual void sync()
Flushes all changes that currently reside only in memory back to disk / permanent storage...
Definition: kconfigbase.cpp:1695
KConfigBase::readNum64Entry
Q_INT64 readNum64Entry(const QString &pKey, Q_INT64 nDefault=0) const
Reads a 64-bit numerical value.
Definition: kconfigbase.cpp:658
KConfigSkeleton::ItemUInt64
Class for handling unsigned 64-bit integer preferences item.
Definition: kconfigskeleton.h:601
KConfigSkeleton::ItemEnum::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:289
KConfigSkeleton::ItemLong::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:459
KConfigBase::readPathEntry
QString readPathEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads a path.
Definition: kconfigbase.cpp:553
KConfigSkeleton::ItemFont::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:672
KConfigSkeleton::ItemUInt::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:359
KConfigSkeleton::ItemBool
Class for handling a bool preferences item.
Definition: kconfigskeleton.h:432
KConfigSkeleton::ItemBool::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:148
KConfigSkeleton::ItemInt::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:175
KConfigSkeleton::ItemIntList::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:869
KConfigSkeleton::readConfig
void readConfig()
Read preferences from config file.
Definition: kconfigskeleton.cpp:949
KConfigSkeleton::ItemStringList
Class for handling a string list preferences item.
Definition: kconfigskeleton.h:745
KConfigSkeleton::addItemColor
ItemColor * addItemColor(const QString &name, QColor &reference, const QColor &defaultValue=QColor(128, 128, 128), const QString &key=QString::null)
Register an item of type QColor.
Definition: kconfigskeleton.cpp:1118
KConfigSkeleton::ItemFont
Class for handling a font preferences item.
Definition: kconfigskeleton.h:669
KConfigSkeletonItem::readConfig
virtual void readConfig(KConfig *)=0
This function is called by KConfigSkeleton to read the value for this setting from a config file...
KConfigSkeleton::ItemPoint::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:726
KConfigSkeleton::ItemInt64::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:250
KConfigSkeleton::ItemULong::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:535
KConfigSkeleton::ItemDouble::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:597
KConfigSkeleton::ItemEnum::writeConfig
void writeConfig(KConfig *config)
This function is called by KConfigSkeleton to write the value of this setting to a config file...
Definition: kconfigskeleton.cpp:318
KConfigSkeleton::ItemStringList::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:810
KConfigSkeletonItem::readImmutability
void readImmutability(KConfig *config)
sets mIsImmutable to true if mKey in config is immutable
Definition: kconfigskeleton.cpp:35
KConfigSkeleton::usrWriteConfig
virtual void usrWriteConfig()
Implemented by subclasses that write special config values.
Definition: kconfigskeleton.h:1211
KConfigSkeleton::ItemInt64
Class for handling an 64-bit integer preferences item.
Definition: kconfigskeleton.h:472
KConfigSkeleton::ItemLong::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:482
KConfigSkeleton::ItemPassword
Class for handling a password preferences item.
Definition: kconfigskeleton.h:394
KConfigBase::readLongNumEntry
long readLongNumEntry(const QString &pKey, long nDefault=0) const
Reads a numerical value.
Definition: kconfigbase.cpp:621
KConfigSkeleton::ItemPath
Class for handling a path preferences item.
Definition: kconfigskeleton.h:405
KConfigSkeleton::ItemPoint
Class for handling a QPoint preferences item.
Definition: kconfigskeleton.h:699
KConfigSkeleton::addItemPath
ItemPath * addItemPath(const QString &name, QString &reference, const QString &defaultValue=QString::fromLatin1(""), const QString &key=QString::null)
Register a path item of type QString.
Definition: kconfigskeleton.cpp:1018
KConfigSkeleton::ItemRect::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:694
KConfigSkeleton::ItemInt64::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:262
KConfigSkeleton::ItemULong::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:540
KConfigSkeleton::ItemProperty::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:132
KConfigSkeleton::ItemLong
Class for hanlding a long integer preferences item.
Definition: kconfigskeleton.h:550
KConfigSkeleton::addItemBool
ItemBool * addItemBool(const QString &name, bool &reference, bool defaultValue=false, const QString &key=QString::null)
Register an item of type bool.
Definition: kconfigskeleton.cpp:1038
KConfigBase::readDoubleNumEntry
double readDoubleNumEntry(const QString &pKey, double nDefault=0.0) const
Reads a floating point value.
Definition: kconfigbase.cpp:697
KConfigSkeleton::addItemPoint
ItemPoint * addItemPoint(const QString &name, QPoint &reference, const QPoint &defaultValue=QPoint(), const QString &key=QString::null)
Register an item of type QPoint.
Definition: kconfigskeleton.cpp:1148
KConfigSkeleton::ItemPoint::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:721
KConfigSkeleton::ItemProperty::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:123
KConfigBase::readUnsignedLongNumEntry
unsigned long readUnsignedLongNumEntry(const QString &pKey, unsigned long nDefault=0) const
Read an unsigned numerical value.
Definition: kconfigbase.cpp:640
KConfigSkeleton::ItemUInt::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:369
KConfigSkeleton::addItemDouble
ItemDouble * addItemDouble(const QString &name, double &reference, double defaultValue=0.0, const QString &key=QString::null)
Register an item of type double.
Definition: kconfigskeleton.cpp:1108
KConfigSkeleton::ItemSize::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:748
KConfigSkeleton::ItemUInt::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:346
KConfigSkeletonItem::name
QString name() const
Return internal name of entry.
Definition: kconfigskeleton.h:118
KConfigSkeleton::addItemInt64
ItemInt64 * addItemInt64(const QString &name, Q_INT64 &reference, Q_INT64 defaultValue=0, const QString &key=QString::null)
Register an item of type Q_INT64.
Definition: kconfigskeleton.cpp:1068
KConfigSkeleton::useDefaults
bool useDefaults(bool b)
Indicate whether this object should reflect the actual values or the default values.
Definition: kconfigskeleton.cpp:923
KConfigSkeleton::isImmutable
bool isImmutable(const QString &name)
Return whether a certain item is immutable.
Definition: kconfigskeleton.cpp:1198
KConfigSkeleton::ItemInt::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:188
KConfigBase::readColorEntry
QColor readColorEntry(const QString &pKey, const QColor *pDefault=0L) const
Reads a QColor entry.
Definition: kconfigbase.cpp:915
KConfigSkeleton::ItemFont::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:658
KConfigSkeleton::ItemULong::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:517
KConfigSkeleton::writeConfig
void writeConfig()
Write preferences to config file.
Definition: kconfigskeleton.cpp:967
KConfigSkeleton::ItemDouble
Class for handling a floating point preference item.
Definition: kconfigskeleton.h:627
KConfigSkeletonItem::key
QString key() const
Return config file key.
Definition: kconfigskeleton.h:102
KConfigSkeleton::addItemIntList
ItemIntList * addItemIntList(const QString &name, QValueList< int > &reference, const QValueList< int > &defaultValue=QValueList< int >(), const QString &key=QString::null)
Register an item of type QValueList<int>.
Definition: kconfigskeleton.cpp:1188
KConfigBase::writePathEntry
void writePathEntry(const QString &pKey, const QString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Writes a file path.
Definition: kconfigbase.cpp:1061
KConfigSkeleton::ItemDouble::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:587
KConfigSkeleton::ItemPathList::writeConfig
void writeConfig(KConfig *config)
This function is called by KConfigSkeleton to write the value of this setting to a config file...
Definition: kconfigskeleton.cpp:835
KConfigSkeleton::ItemBool::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:157
KConfigSkeleton::ItemBool::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:162
KConfigSkeleton::ItemColor::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:631
KConfigBase::revertToDefault
void revertToDefault(const QString &key)
Reverts the entry with key key in the current group in the application specific config file to either...
Definition: kconfigbase.cpp:1734
KConfigBase::readPathListEntry
QStringList readPathListEntry(const QString &pKey, char sep= ',') const
Reads a list of string paths.
Definition: kconfigbase.cpp:567
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KConfigSkeleton::addItemPassword
ItemPassword * addItemPassword(const QString &name, QString &reference, const QString &defaultValue=QString::fromLatin1(""), const QString &key=QString::null)
Register a password item of type QString.
Definition: kconfigskeleton.cpp:1008
KConfigSkeleton::ItemUInt
Class for handling an unsingend integer preferences item.
Definition: kconfigskeleton.h:524
KConfigSkeleton::KConfigSkeleton
KConfigSkeleton(const QString &configname=QString::null)
Constructor.
Definition: kconfigskeleton.cpp:881
KConfigSkeleton::ItemString::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:91
KConfigSkeleton::ItemDateTime::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:780
KConfigSkeleton::ItemDateTime::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:775
KConfigSkeleton::ItemColor::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:645
KConfigSkeleton::ItemSize
Class for handling a QSize preferences item.
Definition: kconfigskeleton.h:714
KConfigSkeleton::ItemStringList::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:805
KConfigBase::readEntry
QString readEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:203
KConfigSkeleton::ItemInt64::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:255
KConfigSkeleton::ItemPoint::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:712
KConfigSkeleton::ItemIntList::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:874
KGlobal::sharedConfig
static KSharedConfig * sharedConfig()
Returns the general config object.
Definition: kglobal.cpp:68
KConfig::reparseConfiguration
virtual void reparseConfiguration()
Clears all internal data structures and then reread configuration information from disk...
Definition: kconfig.cpp:161
KConfigSkeleton::ItemUInt64::minValue
QVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:426
KConfigSkeleton::ItemUInt64::setProperty
void setProperty(const QVariant &p)
Set item to p.
Definition: kconfigskeleton.cpp:416
KConfigSkeleton::ItemColor
Class for handling a color preferences item.
Definition: kconfigskeleton.h:653
KConfigBase::readUnsignedNum64Entry
Q_UINT64 readUnsignedNum64Entry(const QString &pKey, Q_UINT64 nDefault=0) const
Read an 64-bit unsigned numerical value.
Definition: kconfigbase.cpp:678
KConfigSkeleton::ItemUInt::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:364
KConfigBase::readBoolEntry
bool readBoolEntry(const QString &pKey, bool bDefault=false) const
Reads a boolean entry.
Definition: kconfigbase.cpp:716
KConfigSkeleton::addItemULong
ItemULong * addItemULong(const QString &name, unsigned long &reference, unsigned long defaultValue=0, const QString &key=QString::null)
Register an item of type unsigned long.
Definition: kconfigskeleton.cpp:1098
KConfigSkeletonItem
Class for storing a preferences setting.
Definition: kconfigskeleton.h:50
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
KConfigSkeleton::~KConfigSkeleton
virtual ~KConfigSkeleton()
Destructor.
Definition: kconfigskeleton.cpp:904
KConfigSkeleton::findItem
KConfigSkeletonItem * findItem(const QString &name)
Lookup item by name.
Definition: kconfigskeleton.cpp:1204
KConfigBase::readUnsignedNumEntry
unsigned int readUnsignedNumEntry(const QString &pKey, unsigned int nDefault=0) const
Reads an unsigned numerical value.
Definition: kconfigbase.cpp:602
KConfigSkeleton::ItemUInt::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:376
KConfigSkeleton::usrReadConfig
virtual void usrReadConfig()
Implemented by subclasses that read special config values.
Definition: kconfigskeleton.h:1204
KConfigSkeleton::addItemInt
ItemInt * addItemInt(const QString &name, int &reference, int defaultValue=0, const QString &key=QString::null)
Register an item of type int.
Definition: kconfigskeleton.cpp:1048
KConfigSkeleton::ItemString
Class for handling a string preferences item.
Definition: kconfigskeleton.h:372
KConfigSkeleton::ItemLong::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:489
KConfigBase::entryIsImmutable
bool entryIsImmutable(const QString &key) const
Checks whether it is possible to change the given entry.
Definition: kconfigbase.cpp:164
KConfigBase::setGroup
void setGroup(const QString &group)
Specifies the group in which keys will be read and written.
Definition: kconfigbase.cpp:79
KSharedConfig::openConfig
static KSharedConfig::Ptr openConfig(const QString &fileName, bool readOnly=false, bool bUseKDEGlobals=true)
Returns a ref-counted pointer to a shared read-write config object.
Definition: kconfig.cpp:334
KConfigSkeleton::ItemUInt64::maxValue
QVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: kconfigskeleton.cpp:433
KConfigSkeleton::ItemUInt64::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:421
KConfigBase::writeEntry
void writeEntry(const QString &pKey, const QString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Writes a key/value pair.
Definition: kconfigbase.cpp:1012
KConfigSkeleton::ItemUInt64::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:403
KConfigSkeleton::ItemDateTime::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:766
KConfigSkeleton::ItemProperty::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:137
KConfigSkeleton::ItemIntList
Class for handling an integer list preferences item.
Definition: kconfigskeleton.h:776
KConfigSkeleton::config
KConfig * config() const
Return the KConfig object used for reading and writing the settings.
Definition: kconfigskeleton.cpp:918
KConfigSkeleton::ItemRect::readConfig
void readConfig(KConfig *config)
This function is called by KConfigSkeleton to read the value for this setting from a config file...
Definition: kconfigskeleton.cpp:685
KConfigBase::readNumEntry
int readNumEntry(const QString &pKey, int nDefault=0) const
Reads a numerical value.
Definition: kconfigbase.cpp:581
KConfigSkeleton::ItemDateTime
Class for handling a QDateTime preferences item.
Definition: kconfigskeleton.h:729
KConfigBase::group
QString group() const
Returns the name of the group in which we are searching for keys and from which we are retrieving ent...
Definition: kconfigbase.cpp:100
KConfigSkeleton::addItemUInt
ItemUInt * addItemUInt(const QString &name, unsigned int &reference, unsigned int defaultValue=0, const QString &key=QString::null)
Register an item of type unsigned int.
Definition: kconfigskeleton.cpp:1058
KConfigSkeleton::ItemInt::property
QVariant property() const
Return item as property.
Definition: kconfigskeleton.cpp:193

KDE Home | KDE Accessibility Home | Description of Access Keys