kio Library API Documentation

KDirListerCache Class Reference

Design of the cache: There is a single KDirListerCache for the whole process. More...

#include <kdirlister_p.h>

Inheritance diagram for KDirListerCache:

QObject KDirNotify List of all members.

Public Member Functions

 KDirListerCache (int maxCount=10)
void listDir (KDirLister *lister, const KURL &_url, bool _keep, bool _reload)
void stop (KDirLister *lister)
void stop (KDirLister *lister, const KURL &_url)
void setAutoUpdate (KDirLister *lister, bool enable)
void forgetDirs (KDirLister *lister)
void forgetDirs (KDirLister *lister, const KURL &_url, bool notify)
void updateDirectory (const KURL &_dir)
KFileItemListitemsForDir (const KURL &_dir) const
KFileItemfindByName (const KDirLister *lister, const QString &_name) const
KFileItemfindByURL (const KDirLister *lister, const KURL &_url) const
virtual void FilesAdded (const KURL &directory)
 Notify that files have been added in directory The receiver will list that directory again to find the new items (since it needs more than just the names anyway).

virtual void FilesRemoved (const KURL::List &fileList)
 Notify that files have been deleted.

virtual void FilesChanged (const KURL::List &fileList)
 Notify that files have been changed.

virtual void FileRenamed (const KURL &src, const KURL &dst)
 Notify that a file has been renamed.


Static Public Member Functions

KDirListerCacheself ()

Detailed Description

Design of the cache: There is a single KDirListerCache for the whole process.

It holds all the items used by the dir listers (itemsInUse) as well as a cache of the recently used items (itemsCached). Those items are grouped by directory (a DirItem represents a whole directory).

KDirListerCache also runs all the jobs for listing directories, whether they are for normal listing or for updates. For faster lookups, it also stores two dicts: a URL -> dirlister holding that URL (urlsCurrentlyHeld) a URL -> dirlister currently listing that URL (urlsCurrentlyListed)

Definition at line 123 of file kdirlister_p.h.


Member Function Documentation

void KDirListerCache::FilesAdded const KURL directory  )  [virtual]
 

Notify that files have been added in directory The receiver will list that directory again to find the new items (since it needs more than just the names anyway).

Reimplemented from KDirNotify.

Implements KDirNotify.

Definition at line 622 of file kdirlister.cpp.

void KDirListerCache::FilesRemoved const KURL::List fileList  )  [virtual]
 

Notify that files have been deleted.

This call passes the exact urls of the deleted files so that any view showing them can simply remove them or be closed (if its current dir was deleted) Reimplemented from KDirNotify.

Implements KDirNotify.

Definition at line 627 of file kdirlister.cpp.

References QValueList< KURL >::begin(), QValueList< KURL >::ConstIterator(), KURL::directory(), KDirLister::emitDeleteItem(), QValueList< KURL >::end(), QPtrList::first(), KFileItem::isDir(), QPtrList::next(), KURL::setPath(), QPtrList::take(), KURL::url(), and KFileItem::url().

void KDirListerCache::FilesChanged const KURL::List fileList  )  [virtual]
 

Notify that files have been changed.

At the moment, this is only used for new icon, but it could be used for size etc. as well. Note: this is ASYNC so that it can be used with a broadcast

Implements KDirNotify.

Definition at line 671 of file kdirlister.cpp.

References QValueList< KURL >::begin(), QValueList< KURL >::ConstIterator(), KURL::directory(), QValueList< KURL >::end(), QValueList< KURL >::find(), QValueList< KURL >::prepend(), KFileItem::refresh(), and KURL::setPath().

void KDirListerCache::FileRenamed const KURL src,
const KURL dst
[virtual]
 

Notify that a file has been renamed.

Note: this is ASYNC so that it can be used with a broadcast

Reimplemented from KDirNotify.

Definition at line 707 of file kdirlister.cpp.

References KFileItem::refreshMimeType(), KFileItem::setURL(), and KURL::url().


The documentation for this class was generated from the following files:
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:35 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001