[PATCH] Folder icons reflect contents

David Faure faure at kde.org
Tue Aug 15 21:31:36 BST 2006


On Tuesday 08 August 2006 20:13, Aaron J. Seigo wrote:
> m_fileItem->iconName() != KMimeType::mimeType("inode/directory")->icon()
> 
> as for performance, making that exact KMimeType call 1,000,000 times takes 
> ~8.7 seconds on my 1.8Ghz laptop ... so that shouldn't be a problem.

Or better, cache the default directory icon :)
KFileItem does it already:

  static const QString & defaultFolderIcon =
    KGlobal::staticQString(KMimeType::mimeType( "inode/directory" )->KServiceType::icon());

Hmm ok so this breaks if you switch the icon theme on the fly - but is that even possible?

Although now I'm puzzled... Icon themes install modified mimetype .desktop files??? Or how else
can the default icon for inode/directory be changed to another name than "folder"? I thought icon
themes could only install a different folder.png, not change the name of the icon used by a mimetype...

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list