[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    NEW: kconf_update, a framework for updating configuration files.
From:       Waldo Bastian <bastian () kde ! org>
Date:       2001-04-18 18:29:35
[Download RAW message or body]

See also kdelibs/kconf_update. Comments, questions & feature requests welcome!

README kconf_update

Version: 1.0
Author: Waldo Bastian <bastian@kde.org>, <bastian@suse.com>

What it does
============

kconf_update is a tool designed to update config files. Over time applications
sometimes need to rearrange the way configuration options are stored. Since 
such an update shouldn't influence the configuration options that the user
has selected, the application must take care that the options stored in the
old way will still be honoured.

What used to happen is that the application looks up both the old and the
new configuration option and then decides which one to use. This method has 
several drawbacks:
* The application may need to read more configuration files than strictly
needed, resulting in a slower startup.
* The application becomes bigger with code that will only be used once.

kconf_update addresses these problems by offering a framework to update 
configuration files without adding code to the application itself.


How it works
============

Applications can install so called "update files" under 
$KDEDIR/share/apps/kconf_update. An update file has ".upd" as extension and
contains instructions for transferring/converting configuration information 
from one place to another.

Updating the configuration happens automatically, either when KDE gets started
or when kded detects a new update file in the above mentionmed location.

Update files are seperated into sections. Each section has an Id. When a 
section describing a configuration change has been applied, the Id will be 
stored in the file "kconf_updaterc". This information is used to make sure
that a configuration update is only performed once.

If you overwrite an existing update file with a new version that contains a 
new section, only the update instructions from this extra section will be 
performed.

Example update file
===================

# This is comment
Id=kde2.2
File=kioslaverc,kio_httprc
Group=Proxy Settings
Key=NoProxyFor
Key=UseProxy
Key=httpProxy,Proxy
Group=Cache Settings,Cache
Key=MaxCacheSize
Key=UseCache
Group=UserAgent
AllKeys
# End of file


The above update file extracts config information from the file "kioslaverc" 
and stores it into the file "kio_httprc". 

It reads the keys "NoProxyFor", "UseProxy" and "httpProxy" from the group 
"Proxy Settings" in the "kioslaverc" file. If any of these options are present
they are written to the keys "NoProxyFor", "UseProxy" and "Proxy" (!) in
the group "Proxy Settings" in the "kio_httprc" file.

It also reads the keys "MaxCacheSize" and "UseCache" from the group 
"Cache Settings" in the "kioslaverc" file and writes this information to the
keys "MaxCacheSize" and "UseCache" in the group "Cache" (!) in the 
"kio_httprc" file.

Finally it takes all keys in the "UserAgent" group of the file "kioslaverc" 
and moves then to the "UserAgent" group in the "kio_httprc" file.


Have fun,
Waldo
-- 
bastian@kde.org | SuSE Labs KDE Developer | bastian@suse.com
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic