From 917f389250c6e426775bd60a6a66bfb54be1051d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 24 Oct 2007 13:08:37 +0000 Subject: KConfig* API overhaul. only cosmetics, so don't panic. KConfigBase: - remove separator argument from list entry reading/writing functions - introduce {read,write}XdgListEntry() - kill readPathListEntry(), add readPathEntry() overload instead. the default value is not optional any more, as it defines the return type. this is consistent with the readEntry() functions. - rename clean() => markAsClean(), remove rollback() - rename ConfigState => AccessMode, getConfigState() => accessMode() - rename {entry,group}IsImmutable() => is{Entry,Group}Immutable() - remove NLS alias to Localized KConfig: - remove setGroup() & group() - reshuffle OpenFlag enum, introduce NoCascade for symmetry - remove setExtraConfigFiles() alias to addConfigSources() KConfigGroup: - inherit KConfigBase::deleteGroup() overloads - make convertToQVariant() private, it will probably change somehow - KConfig & KConfigGroup: deprecate entryMap() - remove bogus declarations: KConfigGroup::setReadDefaults(), KConfig::readEntryUntranslated() - apidox - reshuffle the declarations in the headers svn path=/trunk/KDE/kdebase/runtime/; revision=728852 --- src/kreadconfig/kreadconfig.cpp | 2 +- src/kreadconfig/kwriteconfig.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/kreadconfig/kreadconfig.cpp b/src/kreadconfig/kreadconfig.cpp index 329f7b05..915c0967 100644 --- a/src/kreadconfig/kreadconfig.cpp +++ b/src/kreadconfig/kreadconfig.cpp @@ -71,7 +71,7 @@ int main(int argc, char **argv) konfig = KGlobal::config().data(); else { - konfig = new KConfig( file, KConfig::CascadeConfig ); + konfig = new KConfig( file, KConfig::NoGlobals ); configMustDeleted=true; } KConfigGroup cfgGroup = konfig->group(group); diff --git a/src/kreadconfig/kwriteconfig.cpp b/src/kreadconfig/kwriteconfig.cpp index 23a4ffa4..2a3be11a 100644 --- a/src/kreadconfig/kwriteconfig.cpp +++ b/src/kreadconfig/kwriteconfig.cpp @@ -52,12 +52,12 @@ int main(int argc, char **argv) KConfig *konfig; if (file.isEmpty()) - konfig = new KConfig(QString::fromLatin1( "kdeglobals"), KConfig::CascadeConfig ); + konfig = new KConfig(QString::fromLatin1( "kdeglobals"), KConfig::NoGlobals ); else - konfig = new KConfig( file, KConfig::CascadeConfig ); + konfig = new KConfig( file, KConfig::NoGlobals ); KConfigGroup cfgGroup = konfig->group(group); - if ( konfig->getConfigState() != KConfig::ReadWrite || cfgGroup.entryIsImmutable( key ) ) return 2; + if ( konfig->accessMode() != KConfig::ReadWrite || cfgGroup.isEntryImmutable( key ) ) return 2; if(type=="bool") { // For symmetry with kreadconfig we accept a wider range of values as true than Qt -- cgit v1.2.1