From 48158d7079cd5f727eade27aa516d8f3133abca2 Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sat, 1 Aug 2020 18:42:36 +0200 Subject: [PATCH] Remove MaximumSize entry from kdeglobals when settings the preview file size limit to "No limit" Instead of setting it to 0, which KIO's PreviewJob interprets as "No previews", breaking previews in konsole and Plasma desktop BUG: 424403 --- src/settings/general/previewssettingspage.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/settings/general/previewssettingspage.cpp b/src/settings/general/previewssettingspage.cpp index 3e435b53c..e52304888 100644 --- a/src/settings/general/previewssettingspage.cpp +++ b/src/settings/general/previewssettingspage.cpp @@ -131,10 +131,14 @@ void PreviewsSettingsPage::applySettings() KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings")); globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins); - const qulonglong maximumLocalSize = static_cast(m_localFileSizeBox->value()) * 1024 * 1024; - globalConfig.writeEntry("MaximumSize", - maximumLocalSize, - KConfigBase::Normal | KConfigBase::Global); + if (!m_localFileSizeBox->value()) { + globalConfig.deleteEntry("MaximumSize", KConfigBase::Normal | KConfigBase::Global); + } else { + const qulonglong maximumLocalSize = static_cast(m_localFileSizeBox->value()) * 1024 * 1024; + globalConfig.writeEntry("MaximumSize", + maximumLocalSize, + KConfigBase::Normal | KConfigBase::Global); + } const qulonglong maximumRemoteSize = static_cast(m_remoteFileSizeBox->value()) * 1024 * 1024; globalConfig.writeEntry("MaximumRemoteSize", -- 2.47.3