org.kde.koala

Class KConfigBackEnd

public class KConfigBackEnd extends Object implements QtSupport

Abstract base class for KDE configuration file loading/saving. This class forms the base for all classes that implement some manner of loading/saving to configuration files. It is an abstract base class, meaning that you cannot directly instantiate objects of this class. As of right now, the only back end available is one to read/write to INI-style files, but in the future, other formats may be available, such as XML or a database.

Author: Preston Brown , Matthias Kalle Dalheimer

UNKNOWN: KDE Configuration file loading/saving abstract base class.

Constructor Summary
protected KConfigBackEnd(Class dummy)
Method Summary
voidchangeFileName(String _fileName, String _resType, boolean _useKDEGlobals)
Changes the filenames associated with this back end.
booleancheckConfigFilesWritable(boolean warnUser)
Check whether the config files are writable.
StringfileName()
Returns the filename as passed to the constructor.
intgetConfigState()
Returns the state of the app-config object.
booleanparseConfigFiles()
Parses all configuration files for a configuration object.
Stringresource()
Returns the resource type as passed to the constructor.
voidsetFileWriteMode(int mode)
Set the file mode for newly created files.
voidsetLocaleString(String _localeString)
Set the locale string that defines the current language.
voidsync(boolean bMerge)
Writes configuration data to file(s).
voidsync()

Constructor Detail

KConfigBackEnd

protected KConfigBackEnd(Class dummy)

Method Detail

changeFileName

public void changeFileName(String _fileName, String _resType, boolean _useKDEGlobals)
Changes the filenames associated with this back end. You should probably reparse your config info after doing this.

Parameters: _fileName the new filename to use _resType the resource type of the fileName specified, _if_ it is not an absolute path (otherwise this parameter is ignored). _useKDEGlobals specifies whether or not to also parse the global KDE configuration files.

UNKNOWN: Changes the filenames associated with this back end.

checkConfigFilesWritable

public boolean checkConfigFilesWritable(boolean warnUser)
Check whether the config files are writable.

Parameters: warnUser Warn the user if the configuration files are not writable.

Returns: Indicates that all of the configuration files used are writable.

UNKNOWN: Check whether the config files are writable.

fileName

public String fileName()
Returns the filename as passed to the constructor.

Returns: the filename as passed to the constructor.

UNKNOWN: Returns the filename as passed to the constructor.

getConfigState

public int getConfigState()
Returns the state of the app-config object.

See Also: KConfig

UNKNOWN: Returns the state of the app-config object.

parseConfigFiles

public boolean parseConfigFiles()
Parses all configuration files for a configuration object. This method must be reimplemented by the derived classes.

Returns: Whether or not parsing was successful.

UNKNOWN: Parses all configuration files for a configuration object.

resource

public String resource()
Returns the resource type as passed to the constructor.

Returns: the resource type as passed to the constructor.

UNKNOWN: Returns the resource type as passed to the constructor.

setFileWriteMode

public void setFileWriteMode(int mode)
Set the file mode for newly created files.

Parameters: mode the filemode (as in chmod)

UNKNOWN: Set the file mode for newly created files.

setLocaleString

public void setLocaleString(String _localeString)
Set the locale string that defines the current language.

Parameters: _localeString the identifier of the language

See Also: KLocale

UNKNOWN: Set the locale string that defines the current language.

sync

public void sync(boolean bMerge)
Writes configuration data to file(s). This method must be reimplemented by the derived classes.

Parameters: 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.

UNKNOWN: Writes configuration data to file(s).

sync

public void sync()