]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodelrolesupdater.h
Merge branch 'release/20.12'
[dolphin.git] / src / kitemviews / kfileitemmodelrolesupdater.h
index 9078c8e0d64cdc89607b27b656c46967a919865d..09706a54a41da41b321587fc22ef1a3f2b83d93b 100644 (file)
@@ -1,21 +1,8 @@
-/***************************************************************************
- *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef KFILEITEMMODELROLESUPDATER_H
 #define KFILEITEMMODELROLESUPDATER_H
@@ -154,6 +141,24 @@ public:
      */
     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;
+
+    /**
+     * If set to true, directories contents are scanned to determine their size
+     * Default true
+     */
+    void setScanDirectories(bool enabled);
+    bool scanDirectories() const;
+
 private slots:
     void slotItemsInserted(const KItemRangeList& itemRanges);
     void slotItemsRemoved(const KItemRangeList& itemRanges);
@@ -212,7 +217,7 @@ private slots:
     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:
     /**
@@ -258,11 +263,6 @@ private:
     bool applyResolvedRoles(int index, ResolveHint hint);
     QHash<QByteArray, QVariant> rolesData(const KFileItem& item);
 
-    /**
-     * @return The number of items of the path \a path.
-     */
-    int subItemsCount(const QString& path) const;
-
     /**
      * Must be invoked if a property has been changed that affects
      * the look of the preview. Takes care to update all previews.
@@ -313,6 +313,8 @@ private:
     QSet<QByteArray> m_roles;
     QSet<QByteArray> m_resolvableRoles;
     QStringList m_enabledPlugins;
+    qulonglong m_localFileSizePreviewLimit;
+    bool m_scanDirectories;
 
     // Items for which the sort role still has to be determined.
     QSet<KFileItem> m_pendingSortRoleItems;
@@ -349,5 +351,3 @@ private:
 };
 
 #endif
-
-