X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/3df68fb667a9d0df0bfe53ff762c88b9fcde28f6..8ffc72e87f4cffa8dce32da06e9a1d51a595765e:/src/panels/information/informationpanelcontent.cpp diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index d54ed66b6..5c1b7ae22 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -166,11 +166,13 @@ InformationPanelContent::~InformationPanelContent() void InformationPanelContent::showItem(const KFileItem& item) { - if (item != m_item) { + // compares item entries, comparing items only compares urls + if (m_item.entry() != item.entry()) { m_item = item; - + m_preview->stopAnimatedImage(); refreshMetaData(); } + refreshPreview(); } @@ -223,21 +225,22 @@ void InformationPanelContent::refreshPreview() if (InformationPanelSettings::previewsShown()) { const QUrl itemUrl = m_item.url(); - const bool isSearchUrl = itemUrl.scheme().contains(QStringLiteral("search")) && m_item.localPath().isEmpty(); + const bool isSearchUrl = itemUrl.scheme().contains(QLatin1String("search")) && m_item.localPath().isEmpty(); if (isSearchUrl) { m_preview->show(); // in the case of a search-URL the URL is not readable for humans // (at least not useful to show in the Information Panel) m_preview->setPixmap( - QIcon::fromTheme(QStringLiteral("nepomuk")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) + QIcon::fromTheme(QStringLiteral("baloo")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) ); } else { refreshPixmapView(); const QString mimeType = m_item.mimetype(); - m_isVideo = mimeType.startsWith(QLatin1String("video/")); + const bool isAnimatedImage = m_preview->isAnimatedImage(itemUrl.toLocalFile()); + m_isVideo = !isAnimatedImage && mimeType.startsWith(QLatin1String("video/")); usePhonon = m_isVideo || mimeType.startsWith(QLatin1String("audio/")); if (usePhonon) { @@ -268,6 +271,9 @@ void InformationPanelContent::refreshPreview() adjustWidgetSizes(parentWidget()->width()); } } else { + if (isAnimatedImage) { + m_preview->setAnimatedImageFileName(itemUrl.toLocalFile()); + } // When we don't need it, hide the phonon widget first to avoid flickering m_phononWidget->hide(); m_preview->show(); @@ -276,6 +282,7 @@ void InformationPanelContent::refreshPreview() } } } else { + m_preview->stopAnimatedImage(); m_preview->hide(); m_phononWidget->hide(); } @@ -303,6 +310,8 @@ void InformationPanelContent::showItems(const KFileItemList& items) m_previewJob->kill(); } + m_preview->stopAnimatedImage(); + m_preview->setPixmap( QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) ); @@ -357,7 +366,6 @@ void InformationPanelContent::showPreview(const KFileItem& item, const QPixmap& pixmap) { m_outdatedPreviewTimer->stop(); - Q_UNUSED(item) QPixmap p = pixmap; KIconLoader::global()->drawOverlays(item.overlays(), p, KIconLoader::Desktop);