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

List:       kde-devel
Subject:    Re: kmidi fix
From:       Waldo Bastian <bastian () ens ! ascom ! ch>
Date:       1999-07-22 8:48:23
[Download RAW message or body]

Some comments (I have only seen the patch, not the actual code)

1)
If you want to save file bar.foo in "savedir"

> -   QString home = KApplication::localkdedir();
>     QDir savedir(home);

Use this:

QString filename = locateLocal("appdata", "bar.foo");

locateLocal will create the directory if it doesn't exist yet.
'filename' will become something like
   "/home/greg/.kde/share/apps/kmidi/bar.foo"

2)
If you want to find resources like e.g. images which are part of 
your application, instead of
> !   QString pixdir = thisapp->kde_datadir() + "/kmidi/pics/";
> !
> 
>     QPixmap pm(pixdir + "kmidilogo.xpm");


Use this:

QPixmap pm(Icon("kmidilogo.xpm")); 

Don't forget to include kglobal.h and kiconloader.h

3)
I saw a function like "loadPlaylist", for this one you can
probably use "locate()" as well. See kstddirs.h for details.

Hope this helps.

Cheers,
Waldo

Greg Lee wrote:
> Here's the patch.  I also removed calls to kdedir() and localkdedir(),
> which produced complaints.  (Couldn't get addResource to work, though.)
> 
> Greg Lee <lee@Hawaii.edu>
> 

-- 
The "gui" in "Penguin" is pronounced "K-D-E"

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

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