]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Consider all thumbnailers for the information panel and tooltips
authorFabian Vogt <fabian@ritter-vogt.de>
Wed, 29 Aug 2018 08:00:24 +0000 (10:00 +0200)
committerFabian Vogt <fabian@ritter-vogt.de>
Wed, 29 Aug 2018 15:19:42 +0000 (17:19 +0200)
Summary:
The text thumbnail is really useful in tooltips, but disabled by default in
KIO. Having just a larger version of the placeholder icon from the theme
doesn't make a lot of sense, so try the best to get a proper preview.
Same applies to the information panel, which would otherwise just
show the same icon.

Test Plan:
Got textfile previews in tooltips and in the information panel even if
disabled.

Reviewers: #dolphin, elvisangelaccio, broulik, markg, ngraham

Reviewed By: #dolphin, broulik, ngraham

Subscribers: abetts, markg, kfm-devel, ngraham

Tags: #dolphin

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

src/panels/information/informationpanelcontent.cpp
src/views/tooltips/tooltipmanager.cpp

index bb30cc81c43dd59686dbfbc0e18546d47fd0fd0f..6f671e683058f6c6af214d0224404868bcdbe001 100644 (file)
@@ -170,7 +170,10 @@ void InformationPanelContent::showItem(const KFileItem& item)
             m_outdatedPreviewTimer->start();
         }
 
-        m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height()));
+        QStringList plugins = KIO::PreviewJob::availablePlugins();
+        m_previewJob = new KIO::PreviewJob(KFileItemList() << item,
+                                           QSize(m_preview->width(), m_preview->height()),
+                                           &plugins);
         m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
         m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
         if (m_previewJob->uiDelegate()) {
index 19c87b0847c95725fdb111ea8c977d64f45f1637..bb2890138a99a952af19c8b076382d9d8714669f 100644 (file)
@@ -129,7 +129,10 @@ void ToolTipManager::startContentRetrieval()
     // Request a preview of the item
     m_fileMetaDataWidget->setPreview(QPixmap());
 
-    KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256));
+    QStringList plugins = KIO::PreviewJob::availablePlugins();
+    KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item,
+                                               QSize(256, 256),
+                                               &plugins);
     job->setIgnoreMaximumSize(m_item.isLocalFile());
     if (job->uiDelegate()) {
         KJobWidgets::setWindow(job, qApp->activeWindow());