diff options
author | Matthew Dawson <matthew@mjdsystems.ca> | 2014-03-28 16:59:51 +0100 |
---|---|---|
committer | David Faure <faure@kde.org> | 2014-03-28 17:08:05 +0100 |
commit | 4846b50aea0bc2262238963a85ab3556c22412e4 (patch) | |
tree | d77772301de7a6ad0dcc4c160bfea526d29929ac /src/core/kcoreconfigskeleton.cpp | |
parent | e1ad9a6192d1e2be6fcb17c8a1e961104d921752 (diff) | |
download | kconfig-4846b50aea0bc2262238963a85ab3556c22412e4.tar.gz kconfig-4846b50aea0bc2262238963a85ab3556c22412e4.tar.bz2 |
Stop re-loading values inside KCoreConfigSkeleton::save().
The extra load of values in KCoreConfigSkeleton is not documented anywhere
that it happens, and in normal circumstances re-loading new values isn't
expecterd during a save operation.
Update various mentions of readConfig/writeConfig to read/save.
Update documentation to match the new names of functions.
Rename writeConfig() to save() and usrWriteConfig() to usrSave()
Rename functions to match the new naming conventions. Also create old deprecated
instances of both functions to ensure that old code continues to operate
correctly. Also make save() non-virtual, for the same reasons read() is
now non-virtual.
Rename usrReadConfig to usrRead, to be consistent with the new name for readConfig.
Rename usrReadConfig to usrRead, and mark the former as deprecated. To maintain
compatibility, usrRead still calls usrReadConfig in its default implementation.
usrReadConfig remains empty.
REVIEW: 117010
Diffstat (limited to 'src/core/kcoreconfigskeleton.cpp')
-rw-r--r-- | src/core/kcoreconfigskeleton.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/core/kcoreconfigskeleton.cpp b/src/core/kcoreconfigskeleton.cpp index 69a4bf04..04b8b071 100644 --- a/src/core/kcoreconfigskeleton.cpp +++ b/src/core/kcoreconfigskeleton.cpp @@ -1073,17 +1073,17 @@ void KCoreConfigSkeleton::read() for (it = d->mItems.constBegin(); it != d->mItems.constEnd(); ++it) { (*it)->readConfig(d->mConfig.data()); } - usrReadConfig(); + usrRead(); } -bool KCoreConfigSkeleton::writeConfig() +bool KCoreConfigSkeleton::save() { //qDebug(); KConfigSkeletonItem::List::ConstIterator it; for (it = d->mItems.constBegin(); it != d->mItems.constEnd(); ++it) { (*it)->writeConfig(d->mConfig.data()); } - if (!usrWriteConfig()) { + if (!usrSave()) { return false; } @@ -1091,7 +1091,6 @@ bool KCoreConfigSkeleton::writeConfig() if (!d->mConfig->sync()) { return false; } - load(); emit configChanged(); } return true; @@ -1106,10 +1105,26 @@ void KCoreConfigSkeleton::usrSetDefaults() { } +void KCoreConfigSkeleton::usrRead() +{ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + usrReadConfig(); +#pragma GCC diagnostic pop +} + void KCoreConfigSkeleton::usrReadConfig() { } +bool KCoreConfigSkeleton::usrSave() +{ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + return usrWriteConfig(); +#pragma GCC diagnostic pop +} + bool KCoreConfigSkeleton::usrWriteConfig() { return true; |