From: Abdelrazak Younes Date: Tue, 5 Jan 2010 13:33:29 +0000 (+0000) Subject: Asynchronous preview: cancel too close preview or update calls. X-Git-Tag: 2.0.0~4585 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=dabac3c61fe7758ece565bf2805a0bee7a22f14b;p=features.git 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 --- 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