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

KDECore

Public Types | Public Member Functions | Static Public Member Functions | List of all members
KSharedConfig Class Reference

#include <KSharedConfig>

Inheritance diagram for KSharedConfig:
Inheritance graph
[legend]

Public Types

typedef KSharedPtr< KSharedConfig > Ptr
 
- Public Types inherited from KConfig
enum  OpenFlag {
  IncludeGlobals = 0x01, CascadeConfig = 0x02, SimpleConfig = 0x00, NoCascade = IncludeGlobals,
  NoGlobals = CascadeConfig, FullConfig = IncludeGlobals|CascadeConfig
}
 
- Public Types inherited from KConfigBase
enum  AccessMode { NoAccess, ReadOnly, ReadWrite }
 
enum  WriteConfigFlag { Persistent = 0x01, Global = 0x02, Localized = 0x04, Normal =Persistent }
 

Public Member Functions

virtual ~KSharedConfig ()
 
- Public Member Functions inherited from KConfig
 KConfig (const QString &file=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
 
 KConfig (const KComponentData &componentData, const QString &file=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
 
 KConfig (const QString &file, const QString &backend, const char *resourceType="config")
 
virtual ~KConfig ()
 
void checkUpdate (const QString &id, const QString &updateFile)
 
const KComponentData & componentData () const
 
KConfig * copyTo (const QString &file, KConfig *config=0) const
 
QMap< QString, QString > entryMap (const QString &aGroup=QString()) const
 
QStringList groupList () const
 
bool isDirty () const
 
void markAsClean ()
 
QString name () const
 
void reparseConfiguration ()
 
void sync ()
 
AccessMode accessMode () const
 
bool isConfigWritable (bool warnUser)
 
void addConfigSources (const QStringList &sources)
 
QString locale () const
 
bool setLocale (const QString &aLocale)
 
void setReadDefaults (bool b)
 
bool readDefaults () const
 
bool isImmutable () const
 
void setForceGlobal (bool force)
 
bool forceGlobal () const
 
- Public Member Functions inherited from KConfigBase
virtual ~KConfigBase ()
 
void deleteGroup (const QByteArray &group, WriteConfigFlags flags=Normal)
 
void deleteGroup (const QString &group, WriteConfigFlags flags=Normal)
 
void deleteGroup (const char *group, WriteConfigFlags flags=Normal)
 
KConfigGroup group (const QByteArray &group)
 
KConfigGroup group (const QString &group)
 
KConfigGroup group (const char *group)
 
const KConfigGroup group (const QByteArray &group) const
 
const KConfigGroup group (const QString &group) const
 
const KConfigGroup group (const char *group) const
 
bool hasGroup (const QString &group) const
 
bool hasGroup (const char *group) const
 
bool hasGroup (const QByteArray &group) const
 
bool isGroupImmutable (const QByteArray &aGroup) const
 
bool isGroupImmutable (const QString &aGroup) const
 
bool isGroupImmutable (const char *aGroup) const
 
- Public Member Functions inherited from QSharedData
 QSharedData ()
 
 QSharedData (const QSharedData &other)
 

Static Public Member Functions

static KSharedConfig::Ptr openConfig (const QString &fileName=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
 
static KSharedConfig::Ptr openConfig (const KComponentData &componentData, const QString &fileName=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
 

Additional Inherited Members

- Protected Member Functions inherited from KConfig
 KConfig (KConfigPrivate &d)
 
virtual void deleteGroupImpl (const QByteArray &group, WriteConfigFlags flags=Normal)
 
virtual bool hasGroupImpl (const QByteArray &group) const
 
virtual bool isGroupImmutableImpl (const QByteArray &aGroup) const
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KConfigBase
 KConfigBase ()
 
- Protected Attributes inherited from KConfig
KConfigPrivate *const d_ptr
 

Detailed Description

KConfig variant using shared memory.

KSharedConfig provides a reference counted, shared memory variant of KConfig. This allows you to use manipulate the same configuration files from different places in your code without worrying about accidentally overwriting changes.

Note that, as with most of kdelibs, this is NOT threadsafe.

Definition at line 40 of file ksharedconfig.h.

Member Typedef Documentation

typedef KSharedPtr<KSharedConfig> KSharedConfig::Ptr

Definition at line 43 of file ksharedconfig.h.

Constructor & Destructor Documentation

KSharedConfig::~KSharedConfig ( )
virtual

Definition at line 69 of file ksharedconfig.cpp.

Member Function Documentation

KSharedConfigPtr KSharedConfig::openConfig ( const QString &  fileName = QString(),
OpenFlags  mode = FullConfig,
const char *  resourceType = "config" 
)
static

Creates a KSharedConfig object to manipulate a configuration file.

If an absolute path is specified for fileName, that file will be used as the store for the configuration settings. If a non-absolute path is provided, the file will be looked for in the standard directory specified by resourceType. If no path is provided, a default configuration file will be used based on the name of the main application component.

mode determines whether the user or global settings will be allowed to influence the values returned by this object. See KConfig::OpenFlags for more details.

Parameters
fileNamethe configuration file to open
modehow global settings should affect the configuration options exposed by this KConfig object
resourceTypeThe standard directory to look for the configuration file in (see KStandardDirs)
See also
KConfig::KConfig(const QString&, OpenFlags, const char*)

Definition at line 31 of file ksharedconfig.cpp.

KSharedConfigPtr KSharedConfig::openConfig ( const KComponentData &  componentData,
const QString &  fileName = QString(),
OpenFlags  mode = FullConfig,
const char *  resourceType = "config" 
)
static

Constructs a KSharedConfig object.

If an absolute path is specified for fileName, that file will be used as the store for the configuration settings. If a non-absolute path is provided, the file will be looked for in the standard directory specified by resourceType. If no path is provided, a default configuration file will be used based on the component's name.

mode determines whether the user or global settings will be allowed to influence the values returned by this object. See KConfig::OpenFlags for more details.

Parameters
componentDatathe component that you wish to load a configuration file for
fileNamethe configuration file to open
modehow global settings should affect the configuration options exposed by this KConfig object
resourceTypeThe standard directory to look for the configuration file in (see KStandardDirs)
See also
KConfig::KConfig(const KComponentData&, const QString&, OpenFlags, const char*)

Definition at line 38 of file ksharedconfig.cpp.


The documentation for this class was generated from the following files:
  • ksharedconfig.h
  • ksharedconfig.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 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