[Kde-games-devel] Re: Resource directory
Ian Wadham
ianw at netspace.net.au
Wed Oct 15 08:56:55 CEST 2003
----- Original Message -----
From: "cantabile" <cantabile.03 at wanadoo.fr>
Sent: Wednesday, October 15, 2003 6:07 AM
> Well, didn't work either...
> > Try findResourceDir("data", "your_app_name/pics/bd.png");
> > your_app_name is the name that you provided to KAboutData in main.
> > Usually all lowercase. It is also the name of the directory of your
> > app in $KDEDIR/share/apps/
>
> I'm lost with these paths things...
>
Who isn't? Or wasn't? The key I think you are looking for is that, in your
Makefile.am, your pics files should go to "$(kde_datadir)/kmatches/pics".
Then, after you have installed your game, Andy's code should find them. The
Makefile.am is tricky to organise in KDevelop 3 at the moment, but see the
last tip in my recent Tips message on the kdevelop newsgroup. Also the
latest KDevelop 3 user manual now has much more explanation about
Automake Manager and how to use it.
$(kde_datadir) is one of several symbolic paths to which files get installed
in a KDE application, depending on the file type (aka "resource type", why
DO they speak this strange language in KDEland?). In this case, your file
type is "data". $(kde_datadir) may evaluate to "/usr/local/kde/share/apps"
or "/opt/kde3/share/apps" or something else, depending on what $(prefix)
is set to (e.g. "/usr/local/kde", "/opt/kde3", etc.).
You can install your game anywhere you like, for testing, if you do
"./configure --prefix=/where/you/like", ... or "/usr/local/kde" is a good
choice (KDevelop 3 default?), especially if you own "/usr/local/kde".
You can also do "export KDEDIRS=/where/you/like:$KDEDIRS" to get
Andy's (official KDE) code to look down the "/where/you/like" path. Note
that KDEDIRS is plural in this case. It is a path variable, like $PATH.
My preference is "KDEDIRS=/mypath:$KDEDIRS /mypath/bin/myapp"
in "bash" Shell, to run a test shot. That gets all the setup in one
command. You can then repeat "KDE", from the Shell history, to
run next time.
To find out more about KDE symbolic paths and current settings, look
for "kde" or "prefix" at the beginning of a line in your Makefile.
All the best, Ian W.
More information about the kde-games-devel
mailing list