┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanelcontent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/panels/information/informationpanelcontent.cpp')
-rw-r--r--src/panels/information/informationpanelcontent.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index b051603fd..2a8682a12 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -169,6 +169,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
if (item != m_item) {
m_item = item;
+ m_preview->stopAnimatedImage();
refreshMetaData();
}
refreshPreview();
@@ -237,7 +238,8 @@ void InformationPanelContent::refreshPreview()
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 +270,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 +281,7 @@ void InformationPanelContent::refreshPreview()
}
}
} else {
+ m_preview->stopAnimatedImage();
m_preview->hide();
m_phononWidget->hide();
}
@@ -303,6 +309,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)
);