Add sharedConfig() accessor, to avoid manipulating a raw KConfig * as returned by config().

This is useful when using kconfigxt and some other code to read from the same
config file (e.g. KColorScheme::contrastF(config)) - no need to call KSharedConfig::openConfig
twice, just grab the KSharedConfig from the generated class.

REVIEW: 115960
wilder
David Faure 12 years ago
parent b2a686625f
commit eb604bc60b
  1. 5
      src/core/kcoreconfigskeleton.cpp
  2. 6
      src/core/kcoreconfigskeleton.h

@ -1022,6 +1022,11 @@ const KConfig *KCoreConfigSkeleton::config() const
return d->mConfig.data();
}
KSharedConfig::Ptr KCoreConfigSkeleton::sharedConfig() const
{
return d->mConfig;
}
void KCoreConfigSkeleton::setSharedConfig(KSharedConfig::Ptr pConfig)
{
d->mConfig = pConfig;

@ -1338,6 +1338,12 @@ public:
*/
const KConfig *config() const;
/**
* Return the @ref KConfig object used for reading and writing the settings.
* @since 5.0
*/
KSharedConfig::Ptr sharedConfig() const;
/**
* Set the @ref KSharedConfig object used for reading and writing the settings.
*/

Loading…
Cancel
Save