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

List:       kde-core-devel
Subject:    Roaming user fixes
From:       Helge Deller <deller () gmx ! de>
Date:       2003-06-21 21:28:30
[Download RAW message or body]

A few people have asked me, what those "roaming user fixes" are all about.
Please let me try to explain the current problem.

All KDE applications use the functions readEntry()/writeEntry() to store values into
configuration files under ~/.kde/share/config. 
Mostly this is no problem, but as soon as hardcoded paths are stored, the application
is bound to the given path and you might run into problems later.

Let's take as example the addressbook configuration file \
(~/.kde/share/config/kabcrc):

[Resource_E9zrABCiHc]
FileName=/home/deller/.kde/share/apps/kabc/std.vcf

This means, that as long as my home directory is /home/deller, I'll have no problems \
at all. But as soon as e.g. the system administrator changes (and copies) my home \
directory to e.g. /mnt/homes/deller, this path is wrong and I won't be able to access \
my addressbook any longer without reconfiguration of kaddressbook and all other apps \
which use similiar absolute paths in their configuration files. Esp. on workstations \
attached to big networks and with user home directories on NFS such situations might  \
happen more often and the solution is pretty simple:

[Resource_E9zrABCiHc]
FileName=$HOME/.kde/share/apps/kabc/std.vcf

In this case, calling readPathEntry() instead of readEntry() will automatically \
expand $HOME to the  full home directory path, and \
writePathEntry(/home/deller/.kde/share/apps/kabc/std.vcf) will store the string $HOME \
instead of "/home/deller" in the config file. This forth-and-back conversion happens \
absolutely transparent to the application and no other changes other than changing \
the necessary readEntry()/writeEntry() calls to the corresponding \
readPathEntry()/writePathEntry() calls are needed. The applications themself will use \
and see at runtime the current home directory only. writePathEntry() and \
readPathEntry() will change strings which contain the user's current home directory \
only.  Other values are not changed and the functions will behave exactly as \
readEntry()/writeEntry() in this case.

One nice benefit of this change is of course, that you now will be able to copy your \
current & favorite KDE  configuration (icons, default paths, font-configuration,...) \
                directly to your best friend by just directly copying the 
.kde subdirectory :-)

Best regards,
Helge


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

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