From 4968c322930fbc5d5ae6e58cc3cb6a22a5515884 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Tue, 19 Oct 2010 10:42:54 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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.")); -- 2.39.5