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

KDECore

KSharedConfig Class Reference

KConfig variant using shared memory. More...

#include <KSharedConfig>

Inheritance diagram for KSharedConfig:

Inheritance graph
[legend]

List of all members.


Public Types

typedef KSharedPtr< KSharedConfig > Ptr

Public Member Functions

virtual ~KSharedConfig ()

Static Public Member Functions

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

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 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:
componentData the component that you wish to load a configuration file for
fileName the configuration file to open
mode how global settings should affect the configuration options exposed by this KConfig object
resourceType The 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.

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:
fileName the configuration file to open
mode how global settings should affect the configuration options exposed by this KConfig object
resourceType The 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.


The documentation for this class was generated from the following files:
  • ksharedconfig.h
  • ksharedconfig.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal