Changeset View
Changeset View
Standalone View
Standalone View
src/settings/general/previewssettingspage.cpp
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #include "dolphin_generalsettings.h" | 22 | #include "dolphin_generalsettings.h" | ||
23 | #include "configurepreviewplugindialog.h" | 23 | #include "configurepreviewplugindialog.h" | ||
24 | 24 | | |||
25 | #include <KConfigGroup> | 25 | #include <KConfigGroup> | ||
26 | #include <KLocalizedString> | 26 | #include <KLocalizedString> | ||
27 | #include <KServiceTypeTrader> | 27 | #include <KServiceTypeTrader> | ||
28 | #include <KService> | 28 | #include <KService> | ||
29 | #include <KIO/PreviewJob> | ||||
29 | 30 | | |||
30 | #include <settings/serviceitemdelegate.h> | 31 | #include <settings/serviceitemdelegate.h> | ||
31 | #include <settings/servicemodel.h> | 32 | #include <settings/servicemodel.h> | ||
32 | 33 | | |||
33 | #include <QCheckBox> | 34 | #include <QCheckBox> | ||
34 | #include <QGroupBox> | 35 | #include <QGroupBox> | ||
35 | #include <QHBoxLayout> | 36 | #include <QHBoxLayout> | ||
36 | #include <QLabel> | 37 | #include <QLabel> | ||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 159 | foreach (const KService::Ptr& service, plugins) { | |||
167 | model->setData(index, service->desktopEntryName(), ServiceModel::DesktopEntryNameRole); | 168 | model->setData(index, service->desktopEntryName(), ServiceModel::DesktopEntryNameRole); | ||
168 | } | 169 | } | ||
169 | 170 | | |||
170 | model->sort(Qt::DisplayRole); | 171 | model->sort(Qt::DisplayRole); | ||
171 | } | 172 | } | ||
172 | 173 | | |||
173 | void PreviewsSettingsPage::loadSettings() | 174 | void PreviewsSettingsPage::loadSettings() | ||
174 | { | 175 | { | ||
175 | KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); | 176 | const KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings")); | ||
176 | m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList() | 177 | m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList()); | ||
177 | << QStringLiteral("directorythumbnail") | 178 | if (m_enabledPreviewPlugins.isEmpty()) { | ||
178 | << QStringLiteral("imagethumbnail") | 179 | m_enabledPreviewPlugins = KIO::PreviewJob::defaultPlugins(); | ||
179 | << QStringLiteral("jpegthumbnail")); | 180 | } | ||
180 | | ||||
181 | const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024; | 181 | const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024; | ||
182 | const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview); | 182 | const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview); | ||
183 | const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024); | 183 | const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024); | ||
184 | m_remoteFileSizeBox->setValue(maxRemoteMByteSize); | 184 | m_remoteFileSizeBox->setValue(maxRemoteMByteSize); | ||
185 | } | 185 | } | ||
186 | 186 | |