mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
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
This commit is contained in:
parent
bebcf035d2
commit
e60e3f07cf
|
@ -99,10 +99,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
|
|||
Q_ASSERT(model);
|
||||
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||
m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList());
|
||||
if (m_enabledPlugins.isEmpty()) {
|
||||
m_enabledPlugins = KIO::PreviewJob::defaultPlugins();
|
||||
}
|
||||
m_enabledPlugins = globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins());
|
||||
|
||||
connect(m_model, &KFileItemModel::itemsInserted,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsInserted);
|
||||
|
|
|
@ -174,10 +174,8 @@ void PreviewsSettingsPage::loadPreviewPlugins()
|
|||
void PreviewsSettingsPage::loadSettings()
|
||||
{
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings"));
|
||||
m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList());
|
||||
if (m_enabledPreviewPlugins.isEmpty()) {
|
||||
m_enabledPreviewPlugins = KIO::PreviewJob::defaultPlugins();
|
||||
}
|
||||
m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins());
|
||||
|
||||
const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024;
|
||||
const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview);
|
||||
const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue