#include <KConfig>
#include <KConfigGroup>
#include <KDebug>
-#include <KDirWatch>
#include <KFileItem>
#include <KGlobal>
#include <KIO/JobUiDelegate>
#include <KIO/PreviewJob>
#include "private/kpixmapmodifier.h"
+#include "private/kdirectorycontentscounter.h"
#include <QApplication>
#include <QPainter>
#include <algorithm>
-#ifdef HAVE_NEPOMUK
- #include "private/knepomukrolesprovider.h"
- #include <Nepomuk2/ResourceWatcher>
-#endif
-
-// Required includes for subItemsCount():
-#ifdef Q_WS_WIN
- #include <QDir>
-#else
- #include <dirent.h>
- #include <QFile>
+#ifdef HAVE_BALOO
+ #include "private/kbaloorolesprovider.h"
+ #include <baloo/file.h>
+ #include <baloo/filefetchjob.h>
+ #include <baloo/filemonitor.h>
#endif
// #define KFILEITEMMODELROLESUPDATER_DEBUG
m_resolvableRoles(),
m_enabledPlugins(),
m_pendingSortRoleItems(),
- m_pendingSortRoleIndexes(),
m_pendingIndexes(),
m_pendingPreviewItems(),
m_previewJob(),
m_recentlyChangedItemsTimer(0),
m_recentlyChangedItems(),
m_changedItems(),
- m_dirWatcher(0),
- m_watchedDirs()
- #ifdef HAVE_NEPOMUK
- , m_nepomukResourceWatcher(0),
- m_nepomukUriItems()
+ m_directoryContentsCounter(0)
+ #ifdef HAVE_BALOO
+ , m_balooFileMonitor(0)
#endif
{
Q_ASSERT(model);
m_resolvableRoles.insert("size");
m_resolvableRoles.insert("type");
m_resolvableRoles.insert("isExpandable");
-#ifdef HAVE_NEPOMUK
- m_resolvableRoles += KNepomukRolesProvider::instance().roles();
+#ifdef HAVE_BALOO
+ m_resolvableRoles += KBalooRolesProvider::instance().roles();
#endif
- // When folders are expandable or the item-count is shown for folders, it is necessary
- // to watch the number of items of the sub-folder to be able to react on changes.
- m_dirWatcher = new KDirWatch(this);
- connect(m_dirWatcher, SIGNAL(dirty(QString)), this, SLOT(slotDirWatchDirty(QString)));
+ m_directoryContentsCounter = new KDirectoryContentsCounter(m_model, this);
+ connect(m_directoryContentsCounter, SIGNAL(result(QString,int)),
+ this, SLOT(slotDirectoryContentsCountReceived(QString,int)));
}
KFileItemModelRolesUpdater::~KFileItemModelRolesUpdater()
resolveNextSortRole();
} else {
m_state = Idle;
- startUpdating();
}
+
+ startUpdating();
}
}
if (m_roles != roles) {
m_roles = roles;
-#ifdef HAVE_NEPOMUK
+#ifdef HAVE_BALOO
// Check whether there is at least one role that must be resolved
- // with the help of Nepomuk. If this is the case, a (quite expensive)
+ // with the help of Baloo. If this is the case, a (quite expensive)
// resolving will be done in KFileItemModelRolesUpdater::rolesData() and
// the role gets watched for changes.
- const KNepomukRolesProvider& rolesProvider = KNepomukRolesProvider::instance();
- bool hasNepomukRole = false;
+ const KBalooRolesProvider& rolesProvider = KBalooRolesProvider::instance();
+ bool hasBalooRole = false;
QSetIterator<QByteArray> it(roles);
while (it.hasNext()) {
const QByteArray& role = it.next();
if (rolesProvider.roles().contains(role)) {
- hasNepomukRole = true;
+ hasBalooRole = true;
break;
}
}
- if (hasNepomukRole && !m_nepomukResourceWatcher) {
- Q_ASSERT(m_nepomukUriItems.isEmpty());
-
- m_nepomukResourceWatcher = new Nepomuk2::ResourceWatcher(this);
- connect(m_nepomukResourceWatcher, SIGNAL(propertyChanged(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariantList,QVariantList)),
- this, SLOT(applyChangedNepomukRoles(Nepomuk2::Resource)));
- } else if (!hasNepomukRole && m_nepomukResourceWatcher) {
- delete m_nepomukResourceWatcher;
- m_nepomukResourceWatcher = 0;
- m_nepomukUriItems.clear();
+ if (hasBalooRole && !m_balooFileMonitor) {
+ m_balooFileMonitor = new Baloo::FileMonitor(this);
+ connect(m_balooFileMonitor, SIGNAL(fileMetaDataChanged(QString)),
+ this, SLOT(applyChangedBalooRoles(QString)));
+ } else if (!hasBalooRole && m_balooFileMonitor) {
+ delete m_balooFileMonitor;
+ m_balooFileMonitor = 0;
}
#endif
applySortProgressToModel();
- // If there are still items whose sort role is unknown, return
- // and handle them asynchronously.
- if (!m_pendingSortRoleItems.isEmpty()) {
- if (m_state != ResolvingSortRole) {
- // Trigger the asynchronous determination of the sort role.
- killPreviewJob();
- m_state = ResolvingSortRole;
- resolveNextSortRole();
- }
- return;
+ // If there are still items whose sort role is unknown, check if the
+ // asynchronous determination of the sort role is already in progress,
+ // and start it if that is not the case.
+ if (!m_pendingSortRoleItems.isEmpty() && m_state != ResolvingSortRole) {
+ killPreviewJob();
+ m_state = ResolvingSortRole;
+ resolveNextSortRole();
}
}
const bool allItemsRemoved = (m_model->count() == 0);
- if (!m_watchedDirs.isEmpty()) {
- // Don't let KDirWatch watch for removed items
+#ifdef HAVE_BALOO
+ if (m_balooFileMonitor) {
+ // Don't let the FileWatcher watch for removed items
if (allItemsRemoved) {
- foreach (const QString& path, m_watchedDirs) {
- m_dirWatcher->removeDir(path);
- }
- m_watchedDirs.clear();
+ m_balooFileMonitor->clear();
} else {
- QMutableSetIterator<QString> it(m_watchedDirs);
- while (it.hasNext()) {
- const QString& path = it.next();
- if (m_model->index(KUrl(path)) < 0) {
- m_dirWatcher->removeDir(path);
- it.remove();
- }
- }
- }
- }
-
-#ifdef HAVE_NEPOMUK
- if (m_nepomukResourceWatcher) {
- // Don't let the ResourceWatcher watch for removed items
- if (allItemsRemoved) {
- m_nepomukResourceWatcher->setResources(QList<Nepomuk2::Resource>());
- m_nepomukResourceWatcher->stop();
- m_nepomukUriItems.clear();
- } else {
- QList<Nepomuk2::Resource> newResources;
- const QList<Nepomuk2::Resource> oldResources = m_nepomukResourceWatcher->resources();
- foreach (const Nepomuk2::Resource& resource, oldResources) {
- const QUrl uri = resource.uri();
- const KUrl itemUrl = m_nepomukUriItems.value(uri);
+ QStringList newFileList;
+ foreach (const QString& itemUrl, m_balooFileMonitor->files()) {
if (m_model->index(itemUrl) >= 0) {
- newResources.append(resource);
- } else {
- m_nepomukUriItems.remove(uri);
+ newFileList.append(itemUrl);
}
}
- m_nepomukResourceWatcher->setResources(newResources);
- if (newResources.isEmpty()) {
- Q_ASSERT(m_nepomukUriItems.isEmpty());
- m_nepomukResourceWatcher->stop();
- }
+ m_balooFileMonitor->setFiles(newFileList);
}
}
#endif
m_finishedItems.clear();
m_pendingSortRoleItems.clear();
- m_pendingSortRoleIndexes.clear();
m_pendingIndexes.clear();
m_pendingPreviewItems.clear();
m_recentlyChangedItems.clear();
Q_UNUSED(itemRange);
Q_UNUSED(movedToIndexes);
- // The indexes of the items with missing sort role are not valid any more.
- m_pendingSortRoleIndexes.clear();
-
// The visible items might have changed.
startUpdating();
}
if (m_resolvableRoles.contains(current)) {
m_pendingSortRoleItems.clear();
- m_pendingSortRoleIndexes.clear();
m_finishedItems.clear();
const int count = m_model->count();
} else {
m_state = Idle;
m_pendingSortRoleItems.clear();
- m_pendingSortRoleIndexes.clear();
applySortProgressToModel();
}
}
}
QHash<QByteArray, QVariant> data = rolesData(item);
+
+ const QStringList overlays = data["iconOverlays"].toStringList();
+ // Strangely KFileItem::overlays() returns empty string-values, so
+ // we need to check first whether an overlay must be drawn at all.
+ // It is more efficient to do it here, as KIconLoader::drawOverlays()
+ // assumes that an overlay will be drawn and has some additional
+ // setup time.
+ foreach (const QString& overlay, overlays) {
+ if (!overlay.isEmpty()) {
+ // There is at least one overlay, draw all overlays above m_pixmap
+ // and cancel the check
+ KIconLoader::global()->drawOverlays(overlays, scaledPixmap, KIconLoader::Desktop);
+ break;
+ }
+ }
+
data.insert("iconPixmap", scaledPixmap);
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
- applyResolvedRoles(item, ResolveAll);
+ applyResolvedRoles(index, ResolveAll);
m_finishedItems.insert(item);
}
}
return;
}
- if (m_pendingSortRoleItems.count() != m_pendingSortRoleIndexes.count()) {
- // The indexes with missing sort role have to be updated.
- m_pendingSortRoleIndexes.clear();
- foreach (const KFileItem& item, m_pendingSortRoleItems) {
- const int index = m_model->index(item);
- if (index < 0) {
- m_pendingSortRoleItems.remove(item);
- } else {
- m_pendingSortRoleIndexes.append(index);
- }
- }
-
- std::sort(m_pendingSortRoleIndexes.begin(), m_pendingSortRoleIndexes.end());
- }
-
- // Try to update an item in the visible range.
- QList<int>::iterator it = std::lower_bound(m_pendingSortRoleIndexes.begin(),
- m_pendingSortRoleIndexes.end(),
- m_firstVisibleIndex);
-
- // It seems that there is no such item. Start with the first item in the list.
- if (it == m_pendingSortRoleIndexes.end()) {
- it = m_pendingSortRoleIndexes.begin();
- }
-
- while (it != m_pendingSortRoleIndexes.end()) {
- // TODO: Note that removing an index from the list m_pendingSortRoleIndexes
- // at a random position is O(N). We might need a better solution
- // to make sure that this does not harm the performance if
- // many items have to be sorted.
- const int index = *it;
- const KFileItem item = m_model->fileItem(index);
+ QSet<KFileItem>::iterator it = m_pendingSortRoleItems.begin();
+ while (it != m_pendingSortRoleItems.end()) {
+ const KFileItem item = *it;
+ const int index = m_model->index(item);
// Continue if the sort role has already been determined for the
// item, and the item has not been changed recently.
if (!m_changedItems.contains(item) && m_model->data(index).contains(m_model->sortRole())) {
- m_pendingSortRoleItems.remove(item);
- m_pendingSortRoleIndexes.erase(it);
-
- // Check if we are at the end of the list (note that the list's end has changed).
- if (it != m_pendingSortRoleIndexes.end()) {
- ++it;
- }
+ it = m_pendingSortRoleItems.erase(it);
continue;
}
applySortRole(index);
- m_pendingSortRoleItems.remove(item);
- m_pendingSortRoleIndexes.erase(it);
+ m_pendingSortRoleItems.erase(it);
break;
}
void KFileItemModelRolesUpdater::resolveNextPendingRoles()
{
- if (m_state != ResolvingAllRoles && m_state != PreviewJobRunning) {
+ if (m_state != ResolvingAllRoles) {
return;
}
continue;
}
- if (m_previewShown) {
- // Only determine the icon. The other roles are resolved when the preview is received.
- applyResolvedRoles(item, ResolveFast);
- } else {
- applyResolvedRoles(item, ResolveAll);
- m_finishedItems.insert(item);
- m_changedItems.remove(item);
- }
-
+ applyResolvedRoles(index, ResolveAll);
+ m_finishedItems.insert(item);
+ m_changedItems.remove(item);
break;
}
if (!m_pendingIndexes.isEmpty()) {
QTimer::singleShot(0, this, SLOT(resolveNextPendingRoles()));
- } else if (m_state != PreviewJobRunning) {
+ } else {
m_state = Idle;
if (m_clearPreviews) {
updateChangedItems();
}
-void KFileItemModelRolesUpdater::applyChangedNepomukRoles(const Nepomuk2::Resource& resource)
+void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& itemUrl)
{
-#ifdef HAVE_NEPOMUK
- const KUrl itemUrl = m_nepomukUriItems.value(resource.uri());
+#ifdef HAVE_BALOO
const KFileItem item = m_model->fileItem(itemUrl);
if (item.isNull()) {
return;
}
- QHash<QByteArray, QVariant> data = rolesData(item);
+ Baloo::FileFetchJob* job = new Baloo::FileFetchJob(item.localPath());
+ connect(job, SIGNAL(finished(KJob*)), this, SLOT(applyChangedBalooRolesJobFinished(KJob*)));
+ job->setProperty("item", QVariant::fromValue(item));
+ job->start();
+#else
+#ifndef Q_CC_MSVC
+ Q_UNUSED(itemUrl);
+#endif
+#endif
+}
+
+void KFileItemModelRolesUpdater::applyChangedBalooRolesJobFinished(KJob* kjob)
+{
+#ifdef HAVE_BALOO
+ const KFileItem item = kjob->property("item").value<KFileItem>();
+
+ const KBalooRolesProvider& rolesProvider = KBalooRolesProvider::instance();
+ QHash<QByteArray, QVariant> data;
+
+ foreach (const QByteArray& role, rolesProvider.roles()) {
+ // Overwrite all the role values with an empty QVariant, because the roles
+ // provider doesn't overwrite it when the property value list is empty.
+ // See bug 322348
+ data.insert(role, QVariant());
+ }
- const KNepomukRolesProvider& rolesProvider = KNepomukRolesProvider::instance();
- QHashIterator<QByteArray, QVariant> it(rolesProvider.roleValues(resource, m_roles));
+ Baloo::FileFetchJob* job = static_cast<Baloo::FileFetchJob*>(kjob);
+ QHashIterator<QByteArray, QVariant> it(rolesProvider.roleValues(job->file(), m_roles));
while (it.hasNext()) {
it.next();
data.insert(it.key(), it.value());
m_model->setData(index, data);
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
-#else
-#ifndef Q_CC_MSVC
- Q_UNUSED(resource);
-#endif
#endif
}
-void KFileItemModelRolesUpdater::slotDirWatchDirty(const QString& path)
+void KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived(const QString& path, int count)
{
const bool getSizeRole = m_roles.contains("size");
const bool getIsExpandableRole = m_roles.contains("isExpandable");
if (getSizeRole || getIsExpandableRole) {
const int index = m_model->index(KUrl(path));
if (index >= 0) {
- if (!m_model->fileItem(index).isDir()) {
- // If INotify is used, KDirWatch issues the dirty() signal
- // also for changed files inside the directory, even if we
- // don't enable this behavior explicitly (see bug 309740).
- return;
- }
-
QHash<QByteArray, QVariant> data;
- const int count = subItemsCount(path);
if (getSizeRole) {
data.insert("size", count);
}
data.insert("isExpandable", count > 0);
}
- // Note that we do not block the itemsChanged signal here.
- // This ensures that a new preview will be generated.
+ disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
+ this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
m_model->setData(index, data);
+ connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
+ this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
}
}
}
void KFileItemModelRolesUpdater::startUpdating()
{
- // Updating the items in and near the visible area makes sense only
- // if sorting is finished.
- if (m_state == ResolvingSortRole || m_state == Paused) {
+ if (m_state == Paused) {
return;
}
return;
}
- int lastVisibleIndex = m_lastVisibleIndex;
- if (lastVisibleIndex <= 0) {
- // Guess a reasonable value for the last visible index if the view
- // has not told us about the real value yet.
- lastVisibleIndex = qMin(m_firstVisibleIndex + m_maximumVisibleItems, m_model->count() - 1);
- if (lastVisibleIndex <= 0) {
- lastVisibleIndex = qMin(200, m_model->count() - 1);
- }
- }
-
// Terminate all updates that are currently active.
killPreviewJob();
m_pendingIndexes.clear();
timer.start();
// Determine the icons for the visible items synchronously.
- int index;
- for (index = m_firstVisibleIndex; index <= lastVisibleIndex && timer.elapsed() < MaxBlockTimeout; ++index) {
- const KFileItem item = m_model->fileItem(index);
- applyResolvedRoles(item, ResolveFast);
+ updateVisibleIcons();
+
+ // A detailed update of the items in and near the visible area
+ // only makes sense if sorting is finished.
+ if (m_state == ResolvingSortRole) {
+ return;
}
- const int firstIndexWithoutIcon = index;
// Start the preview job or the asynchronous resolving of all roles.
QList<int> indexes = indexesToResolve();
}
}
+void KFileItemModelRolesUpdater::updateVisibleIcons()
+{
+ int lastVisibleIndex = m_lastVisibleIndex;
+ if (lastVisibleIndex <= 0) {
+ // Guess a reasonable value for the last visible index if the view
+ // has not told us about the real value yet.
+ lastVisibleIndex = qMin(m_firstVisibleIndex + m_maximumVisibleItems, m_model->count() - 1);
+ if (lastVisibleIndex <= 0) {
+ lastVisibleIndex = qMin(200, m_model->count() - 1);
+ }
+ }
+
+ QElapsedTimer timer;
+ timer.start();
+
+ // Try to determine the final icons for all visible items.
+ int index;
+ for (index = m_firstVisibleIndex; index <= lastVisibleIndex && timer.elapsed() < MaxBlockTimeout; ++index) {
+ applyResolvedRoles(index, ResolveFast);
+ }
+
+ // KFileItemListView::initializeItemListWidget(KItemListWidget*) will load
+ // preliminary icons (i.e., without mime type determination) for the
+ // remaining items.
+}
+
void KFileItemModelRolesUpdater::startPreviewJob()
{
m_state = PreviewJobRunning;
QHash<QByteArray, QVariant> data;
const KFileItem item = m_model->fileItem(index);
- if (index >= m_firstVisibleIndex && index <= m_lastVisibleIndex) {
- // Determine the icon.
- applyResolvedRoles(item, ResolveFast);
- }
-
if (m_model->sortRole() == "type") {
if (!item.isMimeTypeKnown()) {
item.determineMimeType();
data.insert("type", item.mimeComment());
} else if (m_model->sortRole() == "size" && item.isLocalFile() && item.isDir()) {
const QString path = item.localPath();
- data.insert("size", subItemsCount(path));
+ data.insert("size", m_directoryContentsCounter->countDirectoryContentsSynchronously(path));
} else {
- // Probably the sort role is a Nepomuk role - just determine all roles.
+ // Probably the sort role is a baloo role - just determine all roles.
data = rolesData(item);
}
m_model->emitSortProgress(resolvedCount);
}
-bool KFileItemModelRolesUpdater::applyResolvedRoles(const KFileItem& item, ResolveHint hint)
+bool KFileItemModelRolesUpdater::applyResolvedRoles(int index, ResolveHint hint)
{
- if (item.isNull()) {
- return false;
- }
-
+ const KFileItem item = m_model->fileItem(index);
const bool resolveAll = (hint == ResolveAll);
bool iconChanged = false;
if (!item.isMimeTypeKnown() || !item.isFinalIconKnown()) {
item.determineMimeType();
iconChanged = true;
- } else if (m_state == ResolvingSortRole || m_state == PreviewJobRunning) {
- // We are currently performing a fast determination of all icons
- // in the visible area.
- const int index = m_model->index(item);
- if (!m_model->data(index).contains("iconName")) {
- iconChanged = true;
- }
+ } else if (!m_model->data(index).contains("iconName")) {
+ iconChanged = true;
}
if (iconChanged || resolveAll || m_clearPreviews) {
- const int index = m_model->index(item);
if (index < 0) {
return false;
}
return false;
}
-QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileItem& item) const
+QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileItem& item)
{
QHash<QByteArray, QVariant> data;
if ((getSizeRole || getIsExpandableRole) && item.isDir()) {
if (item.isLocalFile()) {
+ // Tell m_directoryContentsCounter that we want to count the items
+ // inside the directory. The result will be received in slotDirectoryContentsCountReceived.
const QString path = item.localPath();
- const int count = subItemsCount(path);
- if (getSizeRole) {
- data.insert("size", count);
- }
- if (getIsExpandableRole) {
- data.insert("isExpandable", count > 0);
- }
-
- if (!m_dirWatcher->contains(path)) {
- m_dirWatcher->addDir(path);
- m_watchedDirs.insert(path);
- }
+ m_directoryContentsCounter->addDirectory(path);
} else if (getSizeRole) {
data.insert("size", -1); // -1 indicates an unknown number of items
}
data.insert("iconOverlays", item.overlays());
-#ifdef HAVE_NEPOMUK
- if (m_nepomukResourceWatcher) {
- const KNepomukRolesProvider& rolesProvider = KNepomukRolesProvider::instance();
- Nepomuk2::Resource resource(item.nepomukUri());
- QHashIterator<QByteArray, QVariant> it(rolesProvider.roleValues(resource, m_roles));
- while (it.hasNext()) {
- it.next();
- data.insert(it.key(), it.value());
- }
-
- QUrl uri = resource.uri();
- if (uri.isEmpty()) {
- // TODO: Is there another way to explicitly create a resource?
- // We need a resource to be able to track it for changes.
- resource.setRating(0);
- uri = resource.uri();
- }
- if (!uri.isEmpty() && !m_nepomukUriItems.contains(uri)) {
- m_nepomukResourceWatcher->addResource(resource);
-
- if (m_nepomukUriItems.isEmpty()) {
- m_nepomukResourceWatcher->start();
- }
-
- m_nepomukUriItems.insert(uri, item.url());
- }
+#ifdef HAVE_BALOO
+ if (m_balooFileMonitor) {
+ m_balooFileMonitor->addFile(item.localPath());
+ applyChangedBalooRoles(item.localPath());
}
#endif
-
return data;
}
-int KFileItemModelRolesUpdater::subItemsCount(const QString& path) const
-{
- const bool countHiddenFiles = m_model->showHiddenFiles();
- const bool showFoldersOnly = m_model->showDirectoriesOnly();
-
-#ifdef Q_WS_WIN
- QDir dir(path);
- QDir::Filters filters = QDir::NoDotAndDotDot | QDir::System;
- if (countHiddenFiles) {
- filters |= QDir::Hidden;
- }
- if (showFoldersOnly) {
- filters |= QDir::Dirs;
- } else {
- filters |= QDir::AllEntries;
- }
- return dir.entryList(filters).count();
-#else
- // Taken from kdelibs/kio/kio/kdirmodel.cpp
- // Copyright (C) 2006 David Faure <faure@kde.org>
-
- int count = -1;
- DIR* dir = ::opendir(QFile::encodeName(path));
- if (dir) { // krazy:exclude=syscalls
- count = 0;
- struct dirent *dirEntry = 0;
- while ((dirEntry = ::readdir(dir))) {
- if (dirEntry->d_name[0] == '.') {
- if (dirEntry->d_name[1] == '\0' || !countHiddenFiles) {
- // Skip "." or hidden files
- continue;
- }
- if (dirEntry->d_name[1] == '.' && dirEntry->d_name[2] == '\0') {
- // Skip ".."
- continue;
- }
- }
-
- // If only directories are counted, consider an unknown file type and links also
- // as directory instead of trying to do an expensive stat()
- // (see bugs 292642 and 299997).
- const bool countEntry = !showFoldersOnly ||
- dirEntry->d_type == DT_DIR ||
- dirEntry->d_type == DT_LNK ||
- dirEntry->d_type == DT_UNKNOWN;
- if (countEntry) {
- ++count;
- }
- }
- ::closedir(dir);
- }
- return count;
-#endif
-}
-
void KFileItemModelRolesUpdater::updateAllPreviews()
{
if (m_state == Paused) {