Author: vfr
Date: Fri Jun 4 15:24:03 2010
New Revision: 34590
URL: http://www.lyx.org/trac/changeset/34590
Log:
Fix bug #6606: Crash when reverting a document with a not available document
class.
If the document class is not available, we now issue a warning for the user.
This triggers a focusInEvent of the WorkArea and the cursor is issued to start
blinking. However, when reverting a document the cursor is probably invalid and
there has been no chance yet to fix it as we are still reading the file.
The solution is to not show the cursor when the view is still busy.
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
lyx-devel/trunk/src/frontends/qt4/GuiView.h
lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp
Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.cpp Thu Jun 3 23:24:20
2010 (r34589)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.cpp Fri Jun 4 15:24:03
2010 (r34590)
@@ -1011,8 +1011,15 @@
}
+bool GuiView::busy()
+{
+ return busy_;
+}
+
+
void GuiView::setBusy(bool busy)
{
+ busy_ = busy;
if (d.current_work_area_) {
d.current_work_area_->setUpdatesEnabled(!busy);
if (busy)
Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.h
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.h Thu Jun 3 23:24:20 2010
(r34589)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.h Fri Jun 4 15:24:03 2010
(r34590)
@@ -73,7 +73,10 @@
int id() const { return id_; }
+ ///
void setBusy(bool);
+ /// are we busy ?
+ bool busy();
/// \name Generic accessor functions
//@{
@@ -402,6 +405,8 @@
/// flag to avoid two concurrent close events.
bool closing_;
+ /// if the view is busy the cursor shouldn't blink for instance.
+ bool busy_;
};
} // namespace frontend
Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp Thu Jun 3 23:24:20
2010 (r34589)
+++ lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp Fri Jun 4 15:24:03
2010 (r34590)
@@ -391,6 +391,10 @@
void GuiWorkArea::startBlinkingCursor()
{
+ // do not show the cursor if the view is busy
+ if (view().busy())
+ return;
+
Point p;
int h = 0;
buffer_view_->cursorPosAndHeight(p, h);