[Kstars-devel] Usage of locateLocal
Jason Harris
jharris at as.arizona.edu
Wed Feb 16 18:59:00 CET 2005
Thanks for pointing this out, Waldo. I'll change locateLocal() to locate(),
where appropriate.
Jason
On Wednesday 16 February 2005 10:33 am, Waldo Bastian wrote:
> 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
--
=--=--=--=--=--=--=--=--=
Dr. Jason Harris
jharris at as.arizona.edu
SO 326 (520) 621-5923
=--=--=--=--=--=--=--=--=
More information about the Kstars-devel
mailing list