From 0cc0b192cd533f760c7863399e6911b48ec4cedb Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Fri, 28 Jan 2005 11:04:03 +0000 Subject: [PATCH] Don't open multiple presentation widgets when slotShowPresentation() is called multiple times (e.g. when the watched PDF has changed) svn path=/trunk/kdegraphics/kpdf/; revision=383178 --- part.cpp | 5 ++++- part.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/part.cpp b/part.cpp index bb50f1704..e8d999055 100644 --- a/part.cpp +++ b/part.cpp @@ -687,7 +687,10 @@ void Part::slotShowProperties() void Part::slotShowPresentation() { - new PresentationWidget( m_document ); + if ( m_presentationWidget ) + delete (PresentationWidget*) m_presentationWidget; + + m_presentationWidget = new PresentationWidget( m_document ); } void Part::slotPrint() diff --git a/part.h b/part.h index 9dd83eec5..0f2dca5cc 100644 --- a/part.h +++ b/part.h @@ -18,6 +18,7 @@ #include #include +#include #include "core/observer.h" #include "dcop.h" @@ -38,6 +39,7 @@ class KPDFDocument; class ThumbnailList; class ThumbnailController; class PageView; +class PresentationWidget; class SearchWidget; namespace KPDF { @@ -123,6 +125,7 @@ private: SearchWidget *m_searchWidget; ThumbnailList *m_thumbnailList; PageView *m_pageView; + QGuardedPtr m_presentationWidget; // static instances counter static unsigned int m_count;