From 4ff27ee637f18262bbd09c13156a3cad17636c51 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 6 Jan 2014 20:15:02 +0100 Subject: Kill any running preview jobs before starting a new one If loading a preview takes long, it was possible before this commit that a preview for a new item was requested before the first preview was shown. In that case, there was a race condition, and the first preview to arrive stayed in the Information Panel. This commit fixes this by keeping a pointer to the preview job and killing it before starting a new one. BUG: 250787 FIXED-IN: 4.12.1 REVIEW: 114561 --- src/panels/information/informationpanelcontent.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/panels/information/informationpanelcontent.h') diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h index ed9200aef..cad6b51b0 100644 --- a/src/panels/information/informationpanelcontent.h +++ b/src/panels/information/informationpanelcontent.h @@ -26,6 +26,8 @@ #include #include +#include + class KFileItemList; class PhononWidget; class PixmapViewer; @@ -35,6 +37,10 @@ class QString; class QLabel; class QScrollArea; +namespace KIO { + class PreviewJob; +} + #ifndef HAVE_NEPOMUK class KFileMetaDataWidget; #else @@ -135,7 +141,7 @@ private: private: KFileItem m_item; - bool m_pendingPreview; + QPointer m_previewJob; QTimer* m_outdatedPreviewTimer; PixmapViewer* m_preview; -- cgit v1.3