From kde-devel Thu Mar 25 09:16:46 2010 From: Lindsay Mathieson Date: Thu, 25 Mar 2010 09:16:46 +0000 To: kde-devel Subject: Re: Spam:****, Re: Application data file location? Message-Id: <201003251916.47054.lindsay.mathieson () gmail ! com> X-MARC-Message: https://marc.info/?l=kde-devel&m=126950869124206 On Thu, 25 Mar 2010 06:57:42 pm Stefan Majewsky wrote: > Am Donnerstag, 25. März 2010 07:19:11 schrieb lindsay.mathieson@gmail.com: > > 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. > > Have a look at KStandardDirs. Example: > > const QString dataFilePath = KStandardDirs::locate("appdata", > > "file.dat"); > > This returns e.g. "/usr/share/kde4/apps/$APPNAME/file.dat" if your $(kde4- > config --prefix) is /usr and the given file exists there. Brilliant, thanks, that's exactly what I was looking for. -- Lindsay http://blackpaw.jalbum.net/home >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<