• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

Public Slots | Public Member Functions | List of all members
KDirListerCache Class Reference

#include <kdirlister_p.h>

Inheritance diagram for KDirListerCache:
QObject

Public Slots

void slotFileRenamed (const QString &srcUrl, const QString &dstUrl)
 
void slotFilesAdded (const QString &urlDirectory)
 
void slotFilesChanged (const QStringList &fileList)
 
void slotFilesRemoved (const QStringList &fileList)
 

Public Member Functions

 KDirListerCache ()
 
 ~KDirListerCache ()
 
void emitItemsFromCache (KDirLister::Private::CachedItemsJob *job, KDirLister *lister, const KUrl &_url, bool _reload, bool _emitCompleted)
 
KFileItem findByName (const KDirLister *lister, const QString &_name) const
 
KFileItem * findByUrl (const KDirLister *lister, const KUrl &url) const
 
void forgetCachedItemsJob (KDirLister::Private::CachedItemsJob *job, KDirLister *lister, const KUrl &url)
 
void forgetDirs (KDirLister *lister)
 
void forgetDirs (KDirLister *lister, const KUrl &_url, bool notify)
 
KFileItem itemForUrl (const KUrl &url) const
 
KFileItemList * itemsForDir (const KUrl &dir) const
 
bool listDir (KDirLister *lister, const KUrl &_url, bool _keep, bool _reload)
 
void setAutoUpdate (KDirLister *lister, bool enable)
 
void stop (KDirLister *lister, bool silent=false)
 
void stopListingUrl (KDirLister *lister, const KUrl &_url, bool silent=false)
 
void updateDirectory (const KUrl &dir)
 

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 a hash table, which gives for a directory URL:

  • the dirlisters holding that URL (listersCurrentlyHolding)
  • the dirlisters currently listing that URL (listersCurrentlyListing)

Definition at line 181 of file kdirlister_p.h.

Constructor & Destructor Documentation

◆ KDirListerCache()

KDirListerCache::KDirListerCache ( )

Definition at line 49 of file kdirlister.cpp.

◆ ~KDirListerCache()

KDirListerCache::~KDirListerCache ( )

Definition at line 75 of file kdirlister.cpp.

Member Function Documentation

◆ emitItemsFromCache()

void KDirListerCache::emitItemsFromCache ( KDirLister::Private::CachedItemsJob *  job,
KDirLister *  lister,
const KUrl &  _url,
bool  _reload,
bool  _emitCompleted 
)

Definition at line 325 of file kdirlister.cpp.

◆ findByName()

KFileItem KDirListerCache::findByName ( const KDirLister *  lister,
const QString &  _name 
) const

Definition at line 807 of file kdirlister.cpp.

◆ findByUrl()

KFileItem * KDirListerCache::findByUrl ( const KDirLister *  lister,
const KUrl &  url 
) const

Definition at line 823 of file kdirlister.cpp.

◆ forgetCachedItemsJob()

void KDirListerCache::forgetCachedItemsJob ( KDirLister::Private::CachedItemsJob *  job,
KDirLister *  lister,
const KUrl &  url 
)

Definition at line 367 of file kdirlister.cpp.

◆ forgetDirs() [1/2]

void KDirListerCache::forgetDirs ( KDirLister *  lister)

Definition at line 513 of file kdirlister.cpp.

◆ forgetDirs() [2/2]

void KDirListerCache::forgetDirs ( KDirLister *  lister,
const KUrl &  _url,
bool  notify 
)

Definition at line 549 of file kdirlister.cpp.

◆ itemForUrl()

KFileItem KDirListerCache::itemForUrl ( const KUrl &  url) const

Definition at line 782 of file kdirlister.cpp.

◆ itemsForDir()

KFileItemList * KDirListerCache::itemsForDir ( const KUrl &  dir) const

Definition at line 801 of file kdirlister.cpp.

◆ listDir()

bool KDirListerCache::listDir ( KDirLister *  lister,
const KUrl &  _url,
bool  _keep,
bool  _reload 
)

Definition at line 91 of file kdirlister.cpp.

◆ setAutoUpdate()

void KDirListerCache::setAutoUpdate ( KDirLister *  lister,
bool  enable 
)

Definition at line 498 of file kdirlister.cpp.

◆ slotFileRenamed

void KDirListerCache::slotFileRenamed ( const QString &  srcUrl,
const QString &  dstUrl 
)
slot

Definition at line 966 of file kdirlister.cpp.

◆ slotFilesAdded

void KDirListerCache::slotFilesAdded ( const QString &  urlDirectory)
slot

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).

Connected to the DBus signal from the KDirNotify interface.

Definition at line 859 of file kdirlister.cpp.

◆ slotFilesChanged

void KDirListerCache::slotFilesChanged ( const QStringList &  fileList)
slot

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. Connected to the DBus signal from the KDirNotify interface.

Definition at line 932 of file kdirlister.cpp.

◆ slotFilesRemoved

void KDirListerCache::slotFilesRemoved ( const QStringList &  fileList)
slot

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) Connected to the DBus signal from the KDirNotify interface.

Definition at line 872 of file kdirlister.cpp.

◆ stop()

void KDirListerCache::stop ( KDirLister *  lister,
bool  silent = false 
)

Definition at line 414 of file kdirlister.cpp.

◆ stopListingUrl()

void KDirListerCache::stopListingUrl ( KDirLister *  lister,
const KUrl &  _url,
bool  silent = false 
)

Definition at line 439 of file kdirlister.cpp.

◆ updateDirectory()

void KDirListerCache::updateDirectory ( const KUrl &  dir)

Definition at line 652 of file kdirlister.cpp.


The documentation for this class was generated from the following files:
  • kdirlister_p.h
  • kdirlister.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal