]> git.lyx.org Git - features.git/commitdiff
Fix bug #6950: Cursor remains in waiting state after incompatible command.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 19 Oct 2010 10:42:54 +0000 (10:42 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 19 Oct 2010 10:42:54 +0000 (10:42 +0000)
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

index 0d878badfe832f06935639b6fe596de8822384fd..724e4f4f47ff10ebac72a82565e26289133acc5e 100644 (file)
@@ -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."));