From dabac3c61fe7758ece565bf2805a0bee7a22f14b Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 5 Jan 2010 13:33:29 +0000 Subject: [PATCH] Asynchronous preview: cancel too close preview or update calls. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32769 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 13cb0c02e3..221af91f79 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -274,8 +274,11 @@ struct GuiView::GuiViewPrivate #if (QT_VERSION >= 0x040400) void setPreviewFuture(QFuture const & f) { - if (preview_watcher_.isRunning()) - preview_watcher_.waitForFinished(); + if (preview_watcher_.isRunning()) { + // we prefer to cancel this preview in order to keep a snappy + // interface. + return; + } preview_watcher_.setFuture(f); } #endif -- 2.39.2