From 2fa1dce9772b556d85b875f6d7d4bf1b466e6dca Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 18 Jan 2011 19:56:18 +0000 Subject: Assure that the enabled plugins for previews are set for the Information Panel and the tooltips. This fixes the issue that a disabled thumbnail-plugin might be chosen. For 4.7 it should be considered to move this code into KIO::filePreview() as default already (will provide a patch on the reviewboard). svn path=/trunk/KDE/kdebase/apps/; revision=1215459 --- src/views/tooltips/tooltipmanager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/views/tooltips/tooltipmanager.cpp') diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index 09e97861a..fdf83d13d 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -20,8 +20,10 @@ #include "tooltipmanager.h" #include "filemetadatatooltip.h" +#include #include #include +#include #include #include @@ -45,7 +47,8 @@ ToolTipManager::ToolTipManager(QAbstractItemView* parent, m_metaDataRequested(false), m_appliedWaitCursor(false), m_item(), - m_itemRect() + m_itemRect(), + m_enabledPlugins() { static FileMetaDataToolTip* sharedToolTip = 0; if (sharedToolTip == 0) { @@ -168,7 +171,14 @@ void ToolTipManager::startContentRetrieval() // Request a preview of the item m_fileMetaDataToolTip->setPreview(QPixmap()); - KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << m_item, 256, 256); + if (m_enabledPlugins.isEmpty()) { + const KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings"); + m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList() + << "directorythumbnail" + << "imagethumbnail" + << "jpegthumbnail"); + } + KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << m_item, 256, 256, true, true, &m_enabledPlugins); connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)), this, SLOT(setPreviewPix(const KFileItem&, const QPixmap&))); -- cgit v1.3