From 0f0d14d4c236eee7f1df4f0c21c60f6b784dab75 Mon Sep 17 00:00:00 2001 From: Gastón Haro Date: Tue, 9 Jun 2020 11:03:30 -0600 Subject: 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 --- src/views/dolphinitemlistview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/views') diff --git a/src/views/dolphinitemlistview.cpp b/src/views/dolphinitemlistview.cpp index 6397a48b7..9e8fda650 100644 --- a/src/views/dolphinitemlistview.cpp +++ b/src/views/dolphinitemlistview.cpp @@ -91,7 +91,7 @@ void DolphinItemListView::readSettings() const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); setEnabledPlugins(globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins())); - + setLocalFileSizePreviewLimit(globalConfig.readEntry("MaximumSize", 0)); endTransaction(); } -- cgit v1.3