From kde-devel Wed Jun 23 16:30:32 1999 From: Robert Williams Date: Wed, 23 Jun 1999 16:30:32 +0000 To: kde-devel Subject: Re: KStandardDir X-MARC-Message: https://marc.info/?l=kde-devel&m=93015437912713 Stephan Kulow wrote: > Harri Porten wrote: > > > > Robert Williams wrote: > > > > > > I am trying to fix Kmahjongg to use KStandardDir so it can be run from > > > the panel. > > > I looked at locateLocal() and that returns $HOME/.kde .... How do you > > > get > > > /opt/kde/share/apps/kmahjongg/picts? > > > > QStringList dirs = KGlobal::dirs()->findDirs("appdata", "picts"); > > > > will give you a _list_ of ../share/apps/kmahjongg/picts directories. > > > > Depending on your need you may iterate trough this list or take, let's > > say the first one, with first(). > > Here is example code out of kmahjongg: > QString str; > str.sprintf( "%1/kmahjongg/pics/%2"). > arg(kapp->kde_datadir()).arg(DEFAULTBACKGROUND); > if( ! loadBackground( str ) ) > > Change this to > if (! loadBackground(locate("appdata", "pics/" + > DEFAULTBACKGROUND)) > > Greetings, Stephan > > -- > As long as Linux remains a religion of freeware fanatics, > Microsoft have nothing to worry about. > By Michael Surkan, PC Week Online That easy? Shoot I have been reading the code about resources and other things. Thank you! -- Robert Williams rwilliams@jrc-utah.com Jarob Consulting rwilliams@kde.org Provo, Utah