The following patch fixes the highly annoying behaviour of the
errorlist inset: every time it gets focus, it acts as if the first
error has been selected. This means in practice that it is not
possible to fix an error without closing the dialog.

This patch is for 1.4. It adds a flag telling whether the controller's
errorlist has been updated since last dialog update. Abdel, should I
do a 1.5 version, or do you have other plans?

JMarc

Index: src/frontends/qt2/QErrorList.C
===================================================================
--- src/frontends/qt2/QErrorList.C	(revision 14625)
+++ src/frontends/qt2/QErrorList.C	(working copy)
@@ -47,6 +47,10 @@ void QErrorList::select(int item)
 
 void QErrorList::update_contents()
 {
+	// is there something to do?
+	if (!controller().hasUnreadList())
+		return;
+
 	setTitle(controller().name());
 	dialog_->errorsLB->clear();
 	dialog_->descriptionTB->setText(QString());
Index: src/frontends/controllers/ControlErrorList.C
===================================================================
--- src/frontends/controllers/ControlErrorList.C	(revision 14625)
+++ src/frontends/controllers/ControlErrorList.C	(working copy)
@@ -25,7 +25,7 @@ namespace lyx {
 namespace frontend {
 
 ControlErrorList::ControlErrorList(Dialog & d)
-	: Dialog::Controller(d)
+	: Dialog::Controller(d), unreadlist_(true)
 {}
 
 
@@ -33,8 +33,9 @@ void ControlErrorList::clearParams()
 {}
 
 
-ErrorList const & ControlErrorList::errorList() const
+ErrorList const & ControlErrorList::errorList()
 {
+	unreadlist_ = false;
 	return errorlist_;
 }
 
@@ -42,11 +43,18 @@ ErrorList const & ControlErrorList::erro
 bool ControlErrorList::initialiseParams(string const & name)
 {
 	errorlist_ = kernel().bufferview()->getErrorList();
+	unreadlist_ = true;
 	name_ = name;
 	return true;
 }
 
 
+bool ControlErrorList::hasUnreadList() const
+{
+	return unreadlist_;
+}
+
+
 string const & ControlErrorList::name()
 {
 	return name_;
Index: src/frontends/controllers/ControlErrorList.h
===================================================================
--- src/frontends/controllers/ControlErrorList.h	(revision 14625)
+++ src/frontends/controllers/ControlErrorList.h	(working copy)
@@ -38,12 +38,17 @@ public:
 	/// return the parent document name
 	std::string const & name();
 	///
-	ErrorList const & errorList() const;
+	ErrorList const & errorList();
+	/// return true when the error list has been updated, but 
+	/// \c errorlist() has not been called.
+	bool hasUnreadList() const;
 private:
 	///
 	ErrorList errorlist_;
 	///
 	std::string name_;
+	/// 
+	bool unreadlist_;
 };
 
 } // namespace frontend

Reply via email to