From: Fabian Vogt Date: Wed, 29 Aug 2018 08:00:24 +0000 (+0200) Subject: Consider all thumbnailers for the information panel and tooltips X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/1d943518ad2b7f6f26bbe05588134758ec424055 Consider all thumbnailers for the information panel and tooltips 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 --- diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index bb30cc81c..6f671e683 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -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()) { diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index 19c87b084..bb2890138 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -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());