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/panels/information/informationpanelcontent.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/panels/information/informationpanelcontent.cpp') diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 591c47ff7..e09ccdf5c 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -63,7 +63,8 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) : m_phononWidget(0), m_nameLabel(0), m_metaDataWidget(0), - m_metaDataArea(0) + m_metaDataArea(0), + m_enabledPlugins() { parent->installEventFilter(this); @@ -173,13 +174,16 @@ void InformationPanelContent::showItem(const KFileItem& item) m_outdatedPreviewTimer->start(); } - KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << item, - m_preview->width(), - m_preview->height(), - 0, - 0, - false, - true); + 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() << item, m_preview->width(), m_preview->height(), + 0, 0, false, true, &m_enabledPlugins); connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)), this, SLOT(showPreview(const KFileItem&, const QPixmap&))); -- cgit v1.3