From: Vincent van Ravesteijn Date: Tue, 19 Oct 2010 10:42:54 +0000 (+0000) Subject: Fix bug #6950: Cursor remains in waiting state after incompatible command. X-Git-Tag: 2.0.0~2344 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4968c322930fbc5d5ae6e58cc3cb6a22a5515884;p=features.git Fix bug #6950: Cursor remains in waiting state after incompatible command. P.S. How do we prevent other cases like this? By throwing exceptions, we never know whether it's assured that we will return to the function to call setBusy(false). In JAVA you always have to either make a function throwable or to catch the exception, but AFAICS you have to crawl through the code to find out whether a function can throw an exception. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35714 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 0d878badfe..724e4f4f47 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1717,7 +1717,13 @@ Buffer * GuiView::loadDocument(FileName const & filename, bool tolastfiles) { setBusy(true); - Buffer * newBuffer = checkAndLoadLyXFile(filename); + Buffer * newBuffer = 0; + try { + newBuffer = checkAndLoadLyXFile(filename); + } catch (ExceptionMessage const & e) { + setBusy(false); + throw(e); + } if (!newBuffer) { message(_("Document not loaded."));