org.kde.koala

Class KConfig

public class KConfig extends KConfigBase

Access KDE Configuration entries. This class implements KDE's default configuration system.

Author: Kalle Dalheimer , Preston Brown

See Also: KGlobal KConfigBase KSimpleConfig

UNKNOWN: KDE Configuration Management class.

Constructor Summary
protected KConfig(Class dummy)
KConfig(String fileName, boolean bReadOnly, boolean bUseKDEGlobals, String resType)
Constructs a KConfig object.
KConfig(String fileName, boolean bReadOnly, boolean bUseKDEGlobals)
KConfig(String fileName, boolean bReadOnly)
KConfig(String fileName)
KConfig()
KConfig(KConfigBackEnd backEnd, boolean bReadOnly)
KConfig(KConfigBackEnd backEnd)
Method Summary
voidcheckUpdate(String id, String updateFile)
Checks whether the config file contains the update id as contained in updateFile. If not, it runs kconf_update to update the config file.
StringclassName()
KConfigcopyTo(String file, KConfig config)
Copies all entries from this config object to a new config object that will save itself to file. Actual saving to file happens when the returned object is destructed or when sync() is called upon it.
KConfigcopyTo(String file)
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
booleanforceGlobal()
Returns true if all entries are being written into kdeglobals.
ArrayListgroupList()
Returns a list of groups that are known.
protected booleaninternalHasGroup(String group)
Returns true if the specified group is known.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
protected KEntrylookupData(KEntryKey _key)
Looks up an entry in the config object's internal structure.
QMetaObjectmetaObject()
protected voidputData(KEntryKey _key, KEntry _data, boolean _checkGroup)
Inserts a (key, value) pair into the internal storage mechanism of the configuration object.
protected voidputData(KEntryKey _key, KEntry _data)
voidreparseConfiguration()
Clears all internal data structures and then reread configuration information from disk.
voidrollback(boolean bDeep)
Clears all entries out of the dirtyEntryMap, so the values will not be written to disk on a later call to sync().
voidrollback()
voidsetFileWriteMode(int mode)
Set the file mode for newly created files.
voidsetForceGlobal(boolean force)
Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in writeEntry().

Constructor Detail

KConfig

protected KConfig(Class dummy)

KConfig

public KConfig(String fileName, boolean bReadOnly, boolean bUseKDEGlobals, String resType)
Constructs a KConfig object.

Parameters: fileName A file to parse in addition to the system-wide file(s). If it is not provided, only global KDE configuration data will be read (depending on the value of bUseKDEGlobals). bReadOnly Set the config object's read-only status. Note that the object will automatically become read-only if either the user does not have write permission to fileName or if no file was specified. bUseKDEGlobals Toggle reading the global KDE configuration file. resType the place to look in (config, data, etc) See KStandardDirs.

UNKNOWN: Constructs a KConfig object.

KConfig

public KConfig(String fileName, boolean bReadOnly, boolean bUseKDEGlobals)

KConfig

public KConfig(String fileName, boolean bReadOnly)

KConfig

public KConfig(String fileName)

KConfig

public KConfig()

KConfig

public KConfig(KConfigBackEnd backEnd, boolean bReadOnly)

KConfig

public KConfig(KConfigBackEnd backEnd)

Method Detail

checkUpdate

public void checkUpdate(String id, String updateFile)
Checks whether the config file contains the update id as contained in updateFile. If not, it runs kconf_update to update the config file. If you install config update files with critical fixes you may wish to use this method to verify that a critical update has indeed been performed to catch the case where a user restores an old config file from backup that has not been updated yet.

Parameters: id the update to check updateFile the file containing the update

UNKNOWN: Checks whether the config file contains the update id as contained in updateFile.

className

public String className()

copyTo

public KConfig copyTo(String file, KConfig config)
Copies all entries from this config object to a new config object that will save itself to file. Actual saving to file happens when the returned object is destructed or when sync() is called upon it.

Parameters: file the new config object will save itself to. config optional config object to reuse

UNKNOWN: Copies all entries from this config object to a new config object that will save itself to file.

copyTo

public KConfig copyTo(String file)

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

forceGlobal

public boolean forceGlobal()
Returns true if all entries are being written into kdeglobals.

Returns: true if all entries are being written into kdeglobals

See Also: KConfig

UNKNOWN: Returns true if all entries are being written into kdeglobals.

groupList

public ArrayList groupList()
Returns a list of groups that are known.

Returns: a list of of groups

UNKNOWN: Returns a list of groups that are known.

internalHasGroup

protected boolean internalHasGroup(String group)
Returns true if the specified group is known.

Parameters: group The group to search for.

Returns: true if the group exists.

UNKNOWN: Returns true if the specified group is known.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

lookupData

protected KEntry lookupData(KEntryKey _key)
Looks up an entry in the config object's internal structure.

Parameters: _key The key to look up It contains information both on the group of the key and the entry's key itself.

Returns: the KEntry value (data) found for the key. KEntry.aValue will be the null string if nothing was located.

UNKNOWN: Looks up an entry in the config object's internal structure.

metaObject

public QMetaObject metaObject()

putData

protected void putData(KEntryKey _key, KEntry _data, boolean _checkGroup)
Inserts a (key, value) pair into the internal storage mechanism of the configuration object.

Parameters: _key The key to insert. It contains information both on the group of the key and the key itself. If the key already exists, the old value will be replaced. _data the KEntry that is to be stored. _checkGroup When false, assume that the group already exists.

UNKNOWN: Inserts a (key, value) pair into the internal storage mechanism of the configuration object.

putData

protected void putData(KEntryKey _key, KEntry _data)

reparseConfiguration

public void reparseConfiguration()
Clears all internal data structures and then reread configuration information from disk.

UNKNOWN: Clears all internal data structures and then reread configuration information from disk.

rollback

public void rollback(boolean bDeep)
Clears all entries out of the dirtyEntryMap, so the values will not be written to disk on a later call to sync().

Parameters: bDeep If true, the dirty map is actually emptied. otherwise, the config object's global dirty flag is set to false, but the dirty entries remain in the dirty entry map.

See Also: KConfigBase

UNKNOWN: Clears all entries out of the dirtyEntryMap, so the values will not be written to disk on a later call to sync().

rollback

public void rollback()

setFileWriteMode

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

Parameters: mode the mode for new files as described in chmod(2)

See Also: :chmod(2) KConfig KConfig KConfig KConfig KConfig

UNKNOWN: Set the file mode for newly created files.

setForceGlobal

public void setForceGlobal(boolean force)
Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in writeEntry().

Parameters: force true to force writing in kdeglobals

See Also: KConfig

UNKNOWN: Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in writeEntry().