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

List:       kde-devel
Subject:    Re: Application data file location?
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2010-03-26 4:43:32
Message-ID: 201003252143.33915.aseigo () kde ! org
[Download RAW message or body]

On March 25, 2010, lindsay.mathieson@gmail.com wrote:
> On Friday 26/03/2010 at 1:53 am, Aaron J. Seigo  wrote:
> > On March 24, 2010, lindsay.mathieson@gmail.com wrote:
> >> With a std KDE4 gui app, is there an api or config item that lets it
> >> know where it can read/write data files to  - not config entries per
> >> say but what ever binary data etc it may need for its own purposes.
> > 
> > KStandardDirs is usually what you need/want for locating such things.
> > you can
> > get to the global KStandardDirs object using KGlobal::dirs(), and the
> > appdata
> > resource is probably what you want in this case.
> 
> Interesting, thanks Aaron - I've been using
> KStandardDirs::locateLocal("appdata", ""), is there any difference or
> preference to using KGlobal::dirs()->locateLocal("appdata", "") ?

the locate*() methods are static, so it doesn't matter. there are other 
methods in KStandardDirs that aren't static (and so require an object) and for 
those ones, KGlobal::dirs() is the way to go.

> On a related note - how would I find documentation on the KGlobal
> namespace at api.kde.org? the search function doesn't find it.

apparently the search doesn't look into namepsaces :/

but if one goes here:

http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/namespaces.html

you find this:

http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/namespaceKGlobal.html

nicely hidden. :/

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
 
>> Visit http://mail.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