]> git.lyx.org Git - features.git/commitdiff
Asynchronous preview: cancel too close preview or update calls.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 5 Jan 2010 13:33:29 +0000 (13:33 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 5 Jan 2010 13:33:29 +0000 (13:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32769 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 13cb0c02e3fa0cfd0e27478a699c690d948c10ce..221af91f79969ffcc3f498bf310eda23ad8389f2 100644 (file)
@@ -274,8 +274,11 @@ struct GuiView::GuiViewPrivate
 #if (QT_VERSION >= 0x040400)
        void setPreviewFuture(QFuture<docstring> 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