#include <KConfig>
#include <KConfigGroup>
-#include <KIO/JobUiDelegate>
#include <KIO/PreviewJob>
#include <KIconLoader>
#include <KJobWidgets>
#include <KPluginMetaData>
#include <KSharedConfig>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include "private/kbaloorolesprovider.h"
#include <Baloo/File>
#include <Baloo/FileMonitor>
#endif
#include <QApplication>
+#include <QElapsedTimer>
#include <QFileInfo>
-#include <QIcon>
#include <QPainter>
#include <QPluginLoader>
-#include <QElapsedTimer>
#include <QTimer>
// #define KFILEITEMMODELROLESUPDATER_DEBUG
m_recentlyChangedItems(),
m_changedItems(),
m_directoryContentsCounter(nullptr)
- #ifdef HAVE_BALOO
+ #if HAVE_BALOO
, m_balooFileMonitor(nullptr)
#endif
{
m_resolvableRoles.insert("size");
m_resolvableRoles.insert("type");
m_resolvableRoles.insert("isExpandable");
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
m_resolvableRoles += KBalooRolesProvider::instance().roles();
#endif
if (m_roles != roles) {
m_roles = roles;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
// Check whether there is at least one role that must be resolved
// with the help of Baloo. If this is the case, a (quite expensive)
// resolving will be done in KFileItemModelRolesUpdater::rolesData() and
const bool allItemsRemoved = (m_model->count() == 0);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
if (m_balooFileMonitor) {
// Don't let the FileWatcher watch for removed items
if (allItemsRemoved) {
void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file)
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file));
if (item.isNull()) {
void KFileItemModelRolesUpdater::applyChangedBalooRolesForItem(const KFileItem &item)
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::File file(item.localPath());
file.load();
for (KOverlayIconPlugin *it : qAsConst(m_overlayIconsPlugin)) {
overlays.append(it->getOverlays(item.url()));
}
- data.insert("iconOverlays", overlays);
+ if (!overlays.isEmpty()) {
+ data.insert("iconOverlays", overlays);
+ }
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
if (m_balooFileMonitor) {
m_balooFileMonitor->addFile(item.localPath());
applyChangedBalooRolesForItem(item);