From: Antonio Rojas Date: Sat, 1 Aug 2020 16:42:36 +0000 (+0200) Subject: Remove MaximumSize entry from kdeglobals when settings the preview file size limit... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/48158d7079cd5f727eade27aa516d8f3133abca2?ds=sidebyside 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 --- 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",