KDE 4.7 PyKDE API Reference

- KDE's Python API

# KSharedConfig Class Reference

`from PyKDE4.kdecore import *`

Inherits: KConfig → KConfigBase

## Detailed Description

\class KSharedConfig ksharedconfig.h <KSharedConfig>

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.

## Methods

| __init__ (self, KComponentData componentData, QString file, KConfig.OpenFlags mode, QString resourceType)

## Static Methods

KSharedPtr<KSharedConfig> | openConfig (QString fileName=QString(), KConfig.OpenFlags mode=KConfig.FullConfig, QString resourceType="config")
KSharedPtr<KSharedConfig> | openConfig (KComponentData componentData, QString fileName=QString(), KConfig.OpenFlags mode=KConfig.FullConfig, QString resourceType="config")

## Method Documentation

__init__ | ( | self, |
|  | KComponentData | componentData,
|  | QString | file,
|  | KConfig.OpenFlags | mode,
|  | QString | resourceType
| ) |  |  |

## Static Method Documentation

KSharedPtr<KSharedConfig> openConfig | ( | QString | fileName=QString(),
|  | KConfig.OpenFlags | mode=KConfig.FullConfig,
|  | QString | resourceType="config"
| ) |  |  |

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)

@sa KConfig.KConfig(const KComponentData&, const QString&, OpenFlags, const char*)

KSharedPtr<KSharedConfig> openConfig | ( | KComponentData | componentData,
|  | QString | fileName=QString(),
|  | KConfig.OpenFlags | mode=KConfig.FullConfig,
|  | QString | resourceType="config"
| ) |  |  |

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)

@sa KConfig.KConfig(const KComponentData&, const QString&, OpenFlags, const char*)