kio Library API Documentation

KMimeTypeResolver< IconItem, Parent > Class Template Reference

This class implements the "delayed-mimetype-determination" feature, for konqueror's directory views (and KFileDialog's :). More...

#include <kmimetyperesolver.h>

List of all members.

Public Member Functions

 KMimeTypeResolver (Parent *parent)
void start (uint delayNonVisibleIcons=10)
 Start the mimetype-determination.

virtual void slotViewportAdjusted ()
 "Connected" to the viewportAdjusted signal of the scrollview

virtual void slotProcessMimeIcons ()
 "Connected" to the timer


Public Attributes

QPtrList< IconItem > m_lstPendingMimeIconItems
 The list of items to process.


Detailed Description

template<class IconItem, class Parent>
class KMimeTypeResolver< IconItem, Parent >

This class implements the "delayed-mimetype-determination" feature, for konqueror's directory views (and KFileDialog's :).

It determines the mimetypes of the icons in the background, but giving preferrence to the visible icons.

It is implemented as a template, so that it can work with both QPtrListViewItem and QIconViewItem, without requiring hacks such as void * or QPtrDict lookups.

Here's what the parent must implement :

Definition at line 118 of file kmimetyperesolver.h.


Member Function Documentation

template<class IconItem, class Parent>
void KMimeTypeResolver< IconItem, Parent >::start uint  delayNonVisibleIcons = 10  )  [inline]
 

Start the mimetype-determination.

Call this when the listing is completed.

Parameters:
delayNonVisibleIcons the delay to use between icons not on screen. Usually 10, but should be set to 0 when the image preview feature is activated, because image preview can only start once we know the mimetypes

Definition at line 137 of file kmimetyperesolver.h.

template<class IconItem, class Parent>
void KMimeTypeResolver< IconItem, Parent >::slotViewportAdjusted  )  [inline, virtual]
 

"Connected" to the viewportAdjusted signal of the scrollview

Definition at line 212 of file kmimetyperesolver.h.

References QPtrList< IconItem >::isEmpty(), KMimeTypeResolver< IconItem, Parent >::m_lstPendingMimeIconItems, and QPtrList< IconItem >::remove().

template<class IconItem, class Parent>
void KMimeTypeResolver< IconItem, Parent >::slotProcessMimeIcons  )  [inline, virtual]
 

"Connected" to the timer

Definition at line 175 of file kmimetyperesolver.h.

References QPtrList< IconItem >::count(), QPtrList< IconItem >::first(), KMimeTypeResolver< IconItem, Parent >::m_lstPendingMimeIconItems, and QPtrList< IconItem >::remove().


Member Data Documentation

template<class IconItem, class Parent>
QPtrList<IconItem> KMimeTypeResolver< IconItem, Parent >::m_lstPendingMimeIconItems
 

The list of items to process.

The view is free to clear it, insert new items into it, remove items, etc.

Definition at line 147 of file kmimetyperesolver.h.

Referenced by KMimeTypeResolver< IconItem, Parent >::slotProcessMimeIcons(), and KMimeTypeResolver< IconItem, Parent >::slotViewportAdjusted().


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:36 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001