#ifndef KFILEITEMMODELROLESUPDATER_H
#define KFILEITEMMODELROLESUPDATER_H
-#include <config-baloo.h>
+#include "dolphin_export.h"
+#include "kitemviews/kitemmodelbase.h"
#include <KFileItem>
-#include <kitemviews/kitemmodelbase.h>
-
-#include "dolphin_export.h"
+#include <config-baloo.h>
#include <QObject>
#include <QSet>
Q_OBJECT
public:
- explicit KFileItemModelRolesUpdater(KFileItemModel* model, QObject* parent = 0);
- virtual ~KFileItemModelRolesUpdater();
+ explicit KFileItemModelRolesUpdater(KFileItemModel* model, QObject* parent = nullptr);
+ ~KFileItemModelRolesUpdater() override;
void setIconSize(const QSize& size);
QSize iconSize() const;
*/
QStringList enabledPlugins() const;
+ /**
+ * Sets the maximum file size of local files for which
+ * previews will be generated (if enabled). A value of 0
+ * indicates no file size limit.
+ * Per default the value from KConfigGroup "PreviewSettings"
+ * MaximumSize is used, 0 otherwise.
+ * @param size
+ */
+ void setLocalFileSizePreviewLimit(qlonglong size);
+ qlonglong localFileSizePreviewLimit() const;
+
private slots:
void slotItemsInserted(const KItemRangeList& itemRanges);
void slotItemsRemoved(const KItemRangeList& itemRanges);
- void slotItemsMoved(const KItemRange& itemRange, QList<int> movedToIndexes);
+ void slotItemsMoved(const KItemRange& itemRange, const QList<int> &movedToIndexes);
void slotItemsChanged(const KItemRangeList& itemRanges,
const QSet<QByteArray>& roles);
void slotSortRoleChanged(const QByteArray& current,
void applyChangedBalooRoles(const QString& file);
void applyChangedBalooRolesForItem(const KFileItem& file);
- void slotDirectoryContentsCountReceived(const QString& path, int count);
+ void slotDirectoryContentsCountReceived(const QString& path, int count, long size);
private:
/**
QSet<QByteArray> m_roles;
QSet<QByteArray> m_resolvableRoles;
QStringList m_enabledPlugins;
+ qulonglong m_localFileSizePreviewLimit;
// Items for which the sort role still has to be determined.
QSet<KFileItem> m_pendingSortRoleItems;