]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinitemlistview.cpp
Provide ability to configure size cut-off for local file previews
[dolphin.git] / src / views / dolphinitemlistview.cpp
index 0655b33080e3b2cf2ec1b71f18248ae807b48493..9e8fda650e37149f1a6d051d1514a2825ebbdb1d 100644 (file)
@@ -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();
 }
 
@@ -124,7 +124,7 @@ void DolphinItemListView::onItemLayoutChanged(ItemLayout current, ItemLayout pre
 
 void DolphinItemListView::onPreviewsShownChanged(bool shown)
 {
-    Q_UNUSED(shown);
+    Q_UNUSED(shown)
     updateGridSize();
 }
 
@@ -179,14 +179,6 @@ void DolphinItemListView::updateGridSize()
         const int minItemWidth = 48;
         itemWidth = minItemWidth + IconsModeSettings::textWidthIndex() * 64;
 
-        if (previewsShown()) {
-            // Optimize the width for previews with a 3:2 aspect ratio instead
-            // of a 1:1 ratio to avoid wasting too much vertical space when
-            // showing photos.
-            const int minWidth = iconSize * 3 / 2;
-            itemWidth = qMax(itemWidth, minWidth);
-        }
-
         if (itemWidth < iconSize + padding * 2) {
             itemWidth = iconSize + padding * 2;
         }