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

List:       kde-devel
Subject:    Re: KStandardDir
From:       Stephan Kulow <coolo () itm ! mu-luebeck ! de>
Date:       1999-06-23 7:45:14
[Download RAW message or body]

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

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

Configure | About | News | Add a list | Sponsored by KoreLogic