[Kstars-devel] Usage of locateLocal

Waldo Bastian bastian at kde.org
Wed Feb 16 18:33:30 CET 2005


Hi,

I noticed that kstars uses a lot of locateLocal() calls instead of locate() 
calls.

In general, when _reading_ a file, you want to use locate() to search the file 
under the user's $HOME/.kde dir and if there is no file there, under $KDEDIR 
instead. This makes it possible for a system administrator to place files in 
$KDEDIR (or in a dedicated KIOSK profile) that can then be used by all users.

By handling this consistently throughout KDE I think this makes KDE really 
nice from an administration point of view, so I would like to see all 
applications, including kstars, follow in this practice where appropriate.

When you change this in the code, keep in mind that while locateLocal() always 
returns a file name, locate() only returns a filename if a file was actually 
found. If no file is found an empty string is returned, so it's important to 
check for this.

When you are about to write a file, locateLocal() is the right function to 
use.

I have changed one occurance of locateLocal in kstarsdata.cpp already, please 
take a look at the remaining ones.

Cheers,
Waldo
-- 
bastian at kde.org   |   Free Novell Linux Desktop 9 Evaluation Download
bastian at suse.com  |   http://www.novell.com/products/desktop/eval.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20050216/3d2da939/attachment.pgp


More information about the Kstars-devel mailing list