[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 16:13:02
[Download RAW message or body]

John Corey wrote:
  
> Icon() does not work with a "pics" dir. Instead you'd have to do
> something like a loadApplicationIcon(locate("toolbar",
> "kmidilogo.xpm")).  I believe if the directory is "icons" it does work
> though.

This is not true. Please check your facts before making statements like this.

Executive explanation
=====================
Icon() loads pixmaps from the following locations:
  
   $HOME/.kde/share/apps/<appName>/toolbar
   $HOME/.kde/share/apps/<appName>/pics
   $HOME/.kde/share/toolbar

   $KDEDIR/share/apps/<appName>/toolbar
   $KDEDIR/share/apps/<appName>/pics
   $KDEDIR/share/toolbar

Long explanation
================
From kiconloader.h:

/**
        Icon loader with caching.

        Multiples loads of the same icons using this class will be cached
        using @ref QPixmapCache, saving memory and loading time. 

        Within KDE there are three distinct groups of Icons:
        
        @li toolbar - Toolbar icons are small icons used on pushbuttons. 
                      The size is 22x22 pixels.

        @li icon - These are icons used to identify an application, 
                   a file type or a directory. They are typically shown
                   on the desktop and in directory listings. Their
                   size is 32x32 pixels or, if KDE has been configured
                   to use large icons, 64x64 pixels

        @li mini - Like 'icon' but with a size of 16x16 pixels. 
        
        Icons are searched for according to the KDE file system standard.


        The default search path for 'toolbar' icons is:
  
        @li $HOME/.kde/share/apps/<appName>/toolbar
        @li $HOME/.kde/share/apps/<appName>/pics
        @li $HOME/.kde/share/toolbar

        @li $KDEDIR/share/apps/<appName>/toolbar
        @li $KDEDIR/share/apps/<appName>/pics
        @li $KDEDIR/share/toolbar


        The default search path for 'icon' icons is:
        
        @li $HOME/.kde/share/apps/<appName>/icons/large (*)
        @li $HOME/.kde/share/apps/<appName>/icons
        @li $HOME/.kde/share/icons/large (*)
        @li $HOME/.kde/share/icons

        @li $KDEDIR/share/apps/<appName>/icons/large (*)
        @li $KDEDIR/share/apps/<appName>/icons
        @li $KDEDIR/share/icons/large (*)
        @li $KDEDIR/share/icons/

        The paths marked with (*) are only searched if KDE
        has been configured to use 'large' icons. 


        The default search path for 'mini' icons is:
        
        @li $HOME/.kde/share/apps/<appName>/icons/mini
        @li $HOME/.kde/share/icons/mini

        @li $KDEDIR/share/apps/<appName>/icons/mini
        @li $KDEDIR/share/icons/mini

        Extra directories can be added, see @ref KStandardDirs.

        All keys used in QPixmapCache by this class have the "$kico_.." prefix.

        @author Christoph Neerfeld (chris@kde.org)
        @version $Id: kiconloader.h,v 1.36 1999/06/27 17:33:28 waba Exp $
*/

loadIcon() loads "toolbar" icons by default. 
(You can change this with "setIconType", but you shouldn't need it.)

loadApplicationIcon() loads "icon" icons.

loadApplicationMiniIcon() loads "mini" icons.

Icon() is an alias for loadIcon:
#define Icon(x) KGlobal::iconLoader()->loadIcon(x,0,0,false)

In 95% of the cases an application can just use "Icon()" to load its pixmaps.
These pixmaps should be installed in a 'pics' dir, or, if they are clearly
intented for a toolbar, in a 'toolbar' dir.

Most applications never need to do anything with application (mini) icons.
(Konqueror and kpanel are typical exceptions to this rule :)

Cheers,
Waldo
-- 
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