]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Turn on Dolphin icon previews by default
authorNathaniel Graham <pointedstick@zoho.com>
Thu, 16 Nov 2017 02:48:29 +0000 (19:48 -0700)
committerNathaniel Graham <pointedstick@zoho.com>
Thu, 16 Nov 2017 02:49:05 +0000 (19:49 -0700)
Summary:
BUG: 338492
BUG: 350212

By default, turn on all preview plugins and turn on previews themselves.

Depends on D8347

Test Plan:
Tested this change in an up-to-date KDE Neon: removed the existing dolphinrc file, deployed Dolphin with the change, and observed that previews are now turned on for all file types for which a plugin exists except for text files, which are in the blacklist because they're mostly useless at nearly all icon sizes (still available in case people want them, though).

Here's how Dolphin's main window looks by default now in KDE Neon:

{F5441184}
(You may notice that there are no previews for the video files; that's because Neon doesn't ship with any plugins for them, so that would be expected at this point)

And here is how the Settings > General > Preview window looks like now by default:
{F5435391}

Reviewers: #dolphin, #vdg, markg, abetts, dfaure, aseigo, elvisangelaccio

Reviewed By: #vdg, abetts, dfaure, elvisangelaccio

Subscribers: abetts, cfeck, andreaska, emmanuelp, andreask, markg, broulik, anthonyfieroni, davidedmundson, ltoscano, dfaure, elvisangelaccio, #konqueror

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D7440

CMakeLists.txt
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/settings/dolphin_directoryviewpropertysettings.kcfg
src/settings/general/previewssettingspage.cpp
src/views/dolphinitemlistview.cpp

index 38fd26bf331a3c1184cc44fab4a1231cdf8c507e..5a39d6288d38711f22cf55b9e7a28a978e80a0e3 100644 (file)
@@ -8,7 +8,7 @@ set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATI
 project(Dolphin VERSION ${KDE_APPLICATIONS_VERSION})
 
 set(QT_MIN_VERSION "5.5.0")
-set(KF5_MIN_VERSION "5.37.0")
+set(KF5_MIN_VERSION "5.40.0")
 set(ECM_MIN_VERSION "1.6.0")
 
 # ECM setup
index 0d7f983113896758eb928ab258cbe846e4581932..8ea106a5ead6dcfb9e608378572b6cf810beaef3 100644 (file)
@@ -99,10 +99,10 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
     Q_ASSERT(model);
 
     const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
-    m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList()
-                                                         << QStringLiteral("directorythumbnail")
-                                                         << QStringLiteral("imagethumbnail")
-                                                         << QStringLiteral("jpegthumbnail"));
+    m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList());
+    if (m_enabledPlugins.isEmpty()) {
+        m_enabledPlugins = KIO::PreviewJob::defaultPlugins();
+    }
 
     connect(m_model, &KFileItemModel::itemsInserted,
             this,    &KFileItemModelRolesUpdater::slotItemsInserted);
index 9584fc8b36f2054af7baf5ff2ba64e9af823bc89..6bcf3cd02bcdaec700c08f7d79b52a4a8fbe8681 100644 (file)
@@ -30,7 +30,7 @@
         <entry name="PreviewsShown" type="Bool" >
             <label context="@label">Previews shown</label>
             <whatsthis context="@info:whatsthis">When this option is enabled, a preview of the file content is shown as an icon.</whatsthis>
-            <default>false</default>
+            <default>true</default>
         </entry>
 
         <entry name="GroupedSorting" type="Bool" >
index 1a92cd16c30380a5da9fe112b5e258f6b9c0a955..ed0d9bd7729a64d9e9221d76b6deb1da0008c870 100644 (file)
@@ -26,6 +26,7 @@
 #include <KLocalizedString>
 #include <KServiceTypeTrader>
 #include <KService>
+#include <KIO/PreviewJob>
 
 #include <settings/serviceitemdelegate.h>
 #include <settings/servicemodel.h>
@@ -172,12 +173,11 @@ void PreviewsSettingsPage::loadPreviewPlugins()
 
 void PreviewsSettingsPage::loadSettings()
 {
-    KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
-    m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList()
-                                                     << QStringLiteral("directorythumbnail")
-                                                     << QStringLiteral("imagethumbnail")
-                                                     << QStringLiteral("jpegthumbnail"));
-
+    const KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings"));
+    m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList());
+    if (m_enabledPreviewPlugins.isEmpty()) {
+        m_enabledPreviewPlugins = 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);
index a3740cb261c92be1d5fc77d6f61641a2551d7f08..d73889fd518ce0e814735889ede2a39fec019c28 100644 (file)
@@ -30,6 +30,7 @@
 #include <kitemviews/kitemlistcontroller.h>
 #include <kitemviews/kitemliststyleoption.h>
 
+#include <KIO/PreviewJob>
 
 #include <views/viewmodecontroller.h>
 
@@ -94,11 +95,11 @@ void DolphinItemListView::readSettings()
     updateGridSize();
 
     const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
-    const QStringList plugins = globalConfig.readEntry("Plugins", QStringList()
-                                                       << QStringLiteral("directorythumbnail")
-                                                       << QStringLiteral("imagethumbnail")
-                                                       << QStringLiteral("jpegthumbnail"));
-    setEnabledPlugins(plugins);
+    QStringList enabledPlugins = globalConfig.readEntry("Plugins", QStringList());
+    if (enabledPlugins.isEmpty()) {
+        enabledPlugins = KIO::PreviewJob::defaultPlugins();
+    }
+    setEnabledPlugins(enabledPlugins);
 
     endTransaction();
 }