┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodelrolesupdater.h
diff options
context:
space:
mode:
authorGastón Haro <[email protected]>2020-06-09 11:03:30 -0600
committerNate Graham <[email protected]>2020-06-09 11:05:55 -0600
commit0f0d14d4c236eee7f1df4f0c21c60f6b784dab75 (patch)
treef8427ac7863efb0e46f77cb961a552d1644d2419 /src/kitemviews/kfileitemmodelrolesupdater.h
parentecc8b18b2a6aa6c45ae2db686cff9a8591c354f0 (diff)
Provide ability to configure size cut-off for local file previews
Summary: FileWidgets read from kdeglobals the property "MaximumSize" under "PreviewSettings" to decide if a preview will be generated for that file. There is no current GUI to change that file size limit. On the other hand Dolphin ignores it. This patch aims to fix that by adding new configuration options to Dolphin. That is a new spinbox in Dolphin settings under General -> Previews tab. Test Plan: 1 - Set up a local folder with 2 jpg images of less and more than 1 MB respectively. 2 - Go to Dolphin Preferences. General -> Previews and check "JPEG Images" from the list. And set "Skip previews for files above:" to 1MB. 3 - Navigate to the afore mentioned folder. Only the image of size less than 1 MB should show a preview. BUG: 331240 Reviewers: ngraham, #dolphin, meven, elvisangelaccio Reviewed By: ngraham, #dolphin, meven, elvisangelaccio Subscribers: cfeck, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28402
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h
index e21cd30df..b881b73e4 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.h
+++ b/src/kitemviews/kfileitemmodelrolesupdater.h
@@ -154,6 +154,17 @@ 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;
+
private slots:
void slotItemsInserted(const KItemRangeList& itemRanges);
void slotItemsRemoved(const KItemRangeList& itemRanges);
@@ -313,6 +324,7 @@ 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;