Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinitemlistview.cpp
Show All 24 Lines | |||||
25 | #include "dolphin_compactmodesettings.h" | 25 | #include "dolphin_compactmodesettings.h" | ||
26 | #include "dolphinfileitemlistwidget.h" | 26 | #include "dolphinfileitemlistwidget.h" | ||
27 | 27 | | |||
28 | #include <kitemviews/kfileitemlistview.h> | 28 | #include <kitemviews/kfileitemlistview.h> | ||
29 | #include <kitemviews/kfileitemmodel.h> | 29 | #include <kitemviews/kfileitemmodel.h> | ||
30 | #include <kitemviews/kitemlistcontroller.h> | 30 | #include <kitemviews/kitemlistcontroller.h> | ||
31 | #include <kitemviews/kitemliststyleoption.h> | 31 | #include <kitemviews/kitemliststyleoption.h> | ||
32 | 32 | | |||
33 | #include <KIO/PreviewJob> | ||||
33 | 34 | | |||
34 | #include <views/viewmodecontroller.h> | 35 | #include <views/viewmodecontroller.h> | ||
35 | 36 | | |||
36 | #include "zoomlevelinfo.h" | 37 | #include "zoomlevelinfo.h" | ||
37 | 38 | | |||
38 | 39 | | |||
39 | DolphinItemListView::DolphinItemListView(QGraphicsWidget* parent) : | 40 | DolphinItemListView::DolphinItemListView(QGraphicsWidget* parent) : | ||
40 | KFileItemListView(parent), | 41 | KFileItemListView(parent), | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 85 | { | |||
89 | 90 | | |||
90 | setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); | 91 | setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); | ||
91 | setSupportsItemExpanding(itemLayoutSupportsItemExpanding(itemLayout())); | 92 | setSupportsItemExpanding(itemLayoutSupportsItemExpanding(itemLayout())); | ||
92 | 93 | | |||
93 | updateFont(); | 94 | updateFont(); | ||
94 | updateGridSize(); | 95 | updateGridSize(); | ||
95 | 96 | | |||
96 | const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); | 97 | const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings"); | ||
97 | const QStringList plugins = globalConfig.readEntry("Plugins", QStringList() | 98 | #if KIO_VERSION >= QT_VERSION_CHECK(5, 40, 0) | ||
98 | << QStringLiteral("directorythumbnail") | 99 | const QStringList plugins = globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins()); | ||
99 | << QStringLiteral("imagethumbnail") | 100 | #else | ||
100 | << QStringLiteral("jpegthumbnail")); | 101 | // We don't have KF5.40 yet; emulate the behavior of KIO::PreviewJob::defaultPlugins() | ||
102 | QStringList defaultPlugins = KIO::PreviewJob::availablePlugins(); | ||||
103 | defaultPlugins.removeAll(QStringLiteral("textthumbnail")); | ||||
104 | const QStringList plugins = globalConfig.readEntry("Plugins", defaultPlugins); | ||||
105 | #endif | ||||
101 | setEnabledPlugins(plugins); | 106 | setEnabledPlugins(plugins); | ||
102 | 107 | | |||
103 | endTransaction(); | 108 | endTransaction(); | ||
104 | } | 109 | } | ||
105 | 110 | | |||
106 | void DolphinItemListView::writeSettings() | 111 | void DolphinItemListView::writeSettings() | ||
107 | { | 112 | { | ||
108 | IconsModeSettings::self()->save(); | 113 | IconsModeSettings::self()->save(); | ||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |