kdecore Library API Documentation

KSimpleConfig Class Reference

KDE Configuration entries KDE Configuration Management class with deletion ability. More...

#include <ksimpleconfig.h>

Inheritance diagram for KSimpleConfig:

KConfig KConfigBase QObject List of all members.

Public Member Functions

 KSimpleConfig (const QString &fileName, bool bReadOnly=false)
 KSimpleConfig (KConfigBackEnd *backEnd, bool bReadOnly=false)
virtual ~KSimpleConfig ()
virtual void sync ()

Protected Member Functions

virtual void virtual_hook (int id, void *data)

Detailed Description

KDE Configuration entries KDE Configuration Management class with deletion ability.

This is a trivial extension of KConfig for applications that need only one configuration file and no default system. A difference with KConfig is that when the data in memory is written back it is not merged with what is on disk. Whatever is in memory simply replaces what is on disk entirely.

Author:
Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org>
Version:
Id
ksimpleconfig.h,v 1.28 2003/08/20 08:01:42 coolo Exp
See also:
KConfigBase KConfig

Definition at line 43 of file ksimpleconfig.h.


Constructor & Destructor Documentation

KSimpleConfig::KSimpleConfig const QString fileName,
bool  bReadOnly = false
 

Construct a KSimpleConfig object and make it either read-write or read-only.

Parameters:
fileName The file used for saving the config data. Either a full path can be specified or just the filename. If only a filename is specified, the default directory for "config" files is used.
bReadOnly Whether the object should be read-only.
Definition at line 39 of file ksimpleconfig.cpp.

References KConfigBackEnd::changeFileName(), QString::isNull(), KConfig::reparseConfiguration(), and KConfigBase::setReadOnly().

KSimpleConfig::~KSimpleConfig  )  [virtual]
 

Destructor.

Writes back any dirty configuration entries. Definition at line 58 of file ksimpleconfig.cpp.

References sync().


Member Function Documentation

void KSimpleConfig::sync  )  [virtual]
 

Flushes all changes that currently reside only in memory back to disk / permanent storage.

Dirty configuration entries are written to the most specific file available.

Asks the back end to flush out all pending writes, and then calls rollback(). No changes are made if the object has readOnly status.

You should call this from your destructor in derivative classes.

See also:
rollback(), isReadOnly()

Reimplemented from KConfigBase.

Definition at line 67 of file ksimpleconfig.cpp.

References KConfigBase::isDirty(), KConfigBase::isReadOnly(), KConfig::rollback(), and KConfigBackEnd::sync().

Referenced by ~KSimpleConfig().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Aug 30 22:53:39 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003