Changeset View
Changeset View
Standalone View
Standalone View
src/settings/general/previewssettingspage.cpp
Show All 16 Lines | |||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #include "previewssettingspage.h" | 20 | #include "previewssettingspage.h" | ||
21 | 21 | | |||
22 | #include "dolphin_generalsettings.h" | 22 | #include "dolphin_generalsettings.h" | ||
23 | #include "configurepreviewplugindialog.h" | 23 | #include "configurepreviewplugindialog.h" | ||
24 | 24 | | |||
25 | #include <KIO/PreviewJob> | ||||
25 | #include <KConfigGroup> | 26 | #include <KConfigGroup> | ||
26 | #include <KLocalizedString> | 27 | #include <KLocalizedString> | ||
27 | #include <KServiceTypeTrader> | 28 | #include <KServiceTypeTrader> | ||
28 | #include <KService> | 29 | #include <KService> | ||
29 | 30 | | |||
30 | #include <settings/serviceitemdelegate.h> | 31 | #include <settings/serviceitemdelegate.h> | ||
31 | #include <settings/servicemodel.h> | 32 | #include <settings/servicemodel.h> | ||
32 | 33 | | |||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | 155 | { | |||
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 | KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); | ||
176 | m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList() | 177 | #if KIO_VERSION >= QT_VERSION_CHECK(5, 40, 0) | ||
177 | << QStringLiteral("directorythumbnail") | 178 | m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins()); | ||
178 | << QStringLiteral("imagethumbnail") | 179 | #else | ||
179 | << QStringLiteral("jpegthumbnail")); | 180 | // We don't have KF5.40 yet; emulate the behavior of KIO::PreviewJob::defaultPlugins() | ||
180 | 181 | QStringList defaultPlugins = KIO::PreviewJob::availablePlugins(); | |||
182 | defaultPlugins.removeAll(QStringLiteral("textthumbnail")); | ||||
183 | m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", defaultPlugins); | ||||
184 | #endif | ||||
181 | const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024; | 185 | const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024; | ||
182 | const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview); | 186 | const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview); | ||
183 | const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024); | 187 | const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024); | ||
184 | m_remoteFileSizeBox->setValue(maxRemoteMByteSize); | 188 | m_remoteFileSizeBox->setValue(maxRemoteMByteSize); | ||
185 | } | 189 | } | ||
186 | 190 | |