KCoreDirListerCache Class

Header: #include <KCoreDirListerCache>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOCore)

Public Slots

void slotFilesAdded(const QString &urlDirectory)
void slotFilesChanged(const QStringList &fileList)
void slotFilesRemoved(const QStringList &fileList)

Detailed Description

Design of the cache: There is a single KCoreDirListerCache 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).

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

Member Function Documentation

[slot] void KCoreDirListerCache::slotFilesAdded(const QString &urlDirectory)

Notify that files have been added in @p 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.

[slot] void KCoreDirListerCache::slotFilesChanged(const QStringList &fileList)

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.

[slot] void KCoreDirListerCache::slotFilesRemoved(const QStringList &fileList)

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.