From e60e3f07cf00823efdde3855cda0dfce36e74c52 Mon Sep 17 00:00:00 2001 From: Nathaniel Graham Date: Thu, 16 Nov 2017 07:23:46 -0700 Subject: Use KConfig::readEntry()'s default argument properly Summary: Follow-on patch to D7440 to use KConfig::readEntry()'s default argument properly to reduce some unnecessary code Test Plan: Tested in KDE Neon. no regressions; by default, all plugins are enabled if the key is not set, and if it is set, user changes to the list are remembered Reviewers: #dolphin, elvisangelaccio, dfaure, apol Reviewed By: #dolphin, elvisangelaccio, apol Differential Revision: https://phabricator.kde.org/D8846 --- src/views/dolphinitemlistview.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/views/dolphinitemlistview.cpp') diff --git a/src/views/dolphinitemlistview.cpp b/src/views/dolphinitemlistview.cpp index d73889fd5..a1472c661 100644 --- a/src/views/dolphinitemlistview.cpp +++ b/src/views/dolphinitemlistview.cpp @@ -95,11 +95,7 @@ void DolphinItemListView::readSettings() updateGridSize(); const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); - QStringList enabledPlugins = globalConfig.readEntry("Plugins", QStringList()); - if (enabledPlugins.isEmpty()) { - enabledPlugins = KIO::PreviewJob::defaultPlugins(); - } - setEnabledPlugins(enabledPlugins); + setEnabledPlugins(globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins())); endTransaction(); } -- cgit v1.3