[Kde-games-devel] Resource directory

cantabile cantabile.03 at wanadoo.fr
Tue Oct 14 03:34:05 CEST 2003


Dear list, 
I'm trying to access pix resources from a directory in my project :
I added to Makefile.am :

CPPFLAGS = -DSRCDIR="\"$(shell (cd $(srcdir) && pwd)) \""

In my main, I have :

KGlobals::dirs()->addResourceDir("data", SRCDIR);

When I write :
QString pixdir = kapp->dirs()->findResourceDir("data", "pics/bd.png")
new QLabel( pixdir, this, "pix directory");

I get nothing in the string. But when I replace pixdir with SRCDIR, I
get a correct path display to my /src subdir...

So, I tried to put pics inside src. No go.
I tried modifying CPPFLAGS string like that : "\"$(shell (cd $(srcdir)
&& pwd))/pics \""

I also tried to access the resource dir with "/pics/db.png" or even
"./pics/db.png" (although it looked queer) and every possible
combination od strings for findResourceDir(). I also read KStandardDir
unit in documentation...

No way. Of course, I double checked the dir itself and the png file is
right there. 

What am I missing ?

Thanks for your help.



More information about the kde-games-devel mailing list