diff options
| author | Frank Reininghaus <[email protected]> | 2014-01-06 20:15:02 +0100 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2014-01-06 20:15:11 +0100 |
| commit | 4ff27ee637f18262bbd09c13156a3cad17636c51 (patch) | |
| tree | 719449c161208a0bf38753a07e0f68f2f71e4f47 /src/panels/information/informationpanelcontent.h | |
| parent | 280fa647f15faf8fdd415328d7ff1fd15c621fc9 (diff) | |
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
Diffstat (limited to 'src/panels/information/informationpanelcontent.h')
| -rw-r--r-- | src/panels/information/informationpanelcontent.h | 8 |
1 files changed, 7 insertions, 1 deletions
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 <KUrl> #include <KVBox> +#include <QPointer> + 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<KIO::PreviewJob> m_previewJob; QTimer* m_outdatedPreviewTimer; PixmapViewer* m_preview; |
