# class KConfigINIBackEnd

###

Table of contents
Modules
kdecore Classes
All Classes

Module | kdecore
Namespace | global
Class | KConfigINIBackEnd
Inherits | KConfigBackEnd

Class for KDE INI-style configuration file loading/saving.

Author Preston Brown <pbrown@kde.org>, Matthias Kalle Dalheimer <kalle@kde.org>

### methods

- KConfigINIBackEnd (_config, _fileName, _resType, _useKDEGlobals)

  returns a KConfigINIBackEnd object

  Argument | Type | Default
  --- | --- | ---
  _config | KConfigBase |
  _fileName | QString |
  _resType | char |
  _useKDEGlobals | bool | True

  Constructs an ini-style configuration back end.

  _config - Specifies the configuration object which values will be passed to as they are read, or from where values to be written to will be obtained from.

  _fileName - The name of the file in which config data is stored. All registered configuration directories will be looked in in order of decreasing relevance.

  _resType - the resource type of the fileName specified, _if_ it is not an absolute path (otherwise this parameter is ignored).

  _useKDEGlobals - If true, the user's system-wide kdeglobals file will be imported into the config object. If false, only the filename specified will be dealt with.

- getEntryMap (map, bGlobal, mergeFile)

  returns (bool)

  Argument | Type | Default
  --- | --- | ---
  map | KEntryMap |
  bGlobal | bool |
  mergeFile | QFile |

  Get the entry map.

  map - the entries will be stored in this object.

  bGlobal - Specifies whether to get only entries which are marked as belonging to the global KDE config file. If this is false, it skips those entries.

  mergeFile - if not null, the dirty entries for this file will be merged.

  Returns Whether there will be some entries left for writing to other files.

- parseConfigFiles ()

  returns (bool)

  Parses all INI-style configuration files for a config object.

  Returns Whether or not parsing was successful.

- parseSingleConfigFile (rFile, pWriteBackMap, bGlobal, bDefault)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  rFile | QFile |
  pWriteBackMap | KEntryMap | None
  bGlobal | bool | False
  bDefault | bool | False

  Parses one configuration file.

  rFile - The configuration file to parse

  pWriteBackMap - If specified, points to a KEntryMap where the data read from the file should be stored, instead of inserting them directly into the configuration object. Use this area as a "scratchpad" when you need to know what is on disk but don't want to effect the configuration object.

  bGlobal - Specifies whether entries should be marked as belonging to the global KDE configuration file rather than the application-specific KDE configuration file(s).

  bDefault - Specifies whether entries should be marked as being default values.

- sync (bMerge)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  bMerge | bool | True

  Writes configuration data to file(s).

  bMerge - Specifies whether the old config file already on disk should be merged in with the data in memory. If true, data is read off the disk and merged. If false, the on-disk file is removed and only in-memory data is written out.

- writeConfigFile (filename, bGlobal, bMerge)

  returns (bool)

  Argument | Type | Default
  --- | --- | ---
  filename | QString |
  bGlobal | bool | False
  bMerge | bool | True

  Writes configuration file back.

  filename - The name of the file to write.

  bGlobal - Specifies whether to write only entries which are marked as belonging to the global KDE config file. If this is false, it skips those entries.

  bMerge - Specifies whether the old config file already on disk should be merged in with the data in memory. If true, data is read off the disk and merged. If false, the on-disk file is removed and only in-memory data is written out. Returns Whether some entries are left to be written to other files.