Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| OK, here is my last patch before holidays (hopefully).
|
| This one continue the drastic diet operated on BufferView. It removes
| all boost signal from BufferView::pimpl and put them in LyXView.
| LyXView already inherits from boost::signals::trackable so this is not
| a big deal. If you look closely at the signal connections, it all
| makes sense IMO.
|
| With this change, the only difference between BufferView.h and
| BufferView_pimpl.h is "cursor.h" so I think it is time to merge at
| last the two classes.
|
| Comments? Objection?
Yes. I belive you have moved a bit too much. In particular the
errorList itself. That is not a frontend thing really it is a
bufferview thing.
OK. Perhaps even Buffer?
| Log:
|
| BufferView:
| * showErrorList(), getErrorList(): transfered to LyXView.
So getErrorList should stay.
OK.
| BufferView::pimpl
| * addError(), showReadonly(), connectBuffer(), disconnectBuffer():
| transfered to LyXView.
addError should stay.
This one would imply that BufferView inherits boost::signal::trackable.
Do you want that?
The attached patch moves back the error_list_ to BufferView (not pimpl
because eventually I will merge it if no one beat me at this while I am
on holydays).
If you really want addError in this too now, I will also do the change.
Other than that I think I agree with the patch.
Good.
Abdel.
Index: BufferView.C
===================================================================
--- BufferView.C (revision 14458)
+++ BufferView.C (working copy)
@@ -165,6 +165,18 @@
}
+ErrorList const & BufferView::getErrorList() const
+{
+ return errorlist_;
+}
+
+
+ErrorList & BufferView::getErrorList()
+{
+ return errorlist_;
+}
+
+
void BufferView::savePosition(unsigned int i)
{
pimpl_->savePosition(i);
Index: BufferView.h
===================================================================
--- BufferView.h (revision 14458)
+++ BufferView.h (working copy)
@@ -15,6 +15,7 @@
#ifndef BUFFER_VIEW_H
#define BUFFER_VIEW_H
+#include "errorlist.h"
#include "metricsinfo.h"
#include "frontends/LyXKeySym.h"
@@ -149,6 +150,10 @@
/// return the lyxtext we are using
LyXText const * getLyXText() const;
+ /// errorlist_ accessor.
+ ErrorList const & BufferView::getErrorList() const;
+ ErrorList & BufferView::getErrorList();
+
/// simple replacing. Use the font of the first selected character
void replaceSelectionWithString(std::string const & str);
@@ -230,6 +235,9 @@
friend class BufferView::Pimpl;
///
Pimpl * pimpl_;
+
+ /// An error list (replaces the error insets)
+ ErrorList errorlist_;
};
#endif // BUFFERVIEW_H
Index: frontends/controllers/ControlErrorList.C
===================================================================
--- frontends/controllers/ControlErrorList.C (revision 14458)
+++ frontends/controllers/ControlErrorList.C (working copy)
@@ -11,7 +11,6 @@
#include <config.h>
#include "ControlErrorList.h"
-#include "frontends/LyXView.h"
#include "buffer.h"
#include "BufferView.h"
#include "debug.h"
@@ -42,7 +41,7 @@
bool ControlErrorList::initialiseParams(string const & name)
{
- errorlist_ = kernel().lyxview().getErrorList();
+ errorlist_ = kernel().bufferview()->getErrorList();
name_ = name;
return true;
}
Index: frontends/LyXView.C
===================================================================
--- frontends/LyXView.C (revision 14458)
+++ frontends/LyXView.C (working copy)
@@ -214,27 +214,21 @@
void LyXView::addError(ErrorItem const & ei)
{
- errorlist_.push_back(ei);
+ work_area_->bufferView().getErrorlist().push_back(ei);
}
void LyXView::showErrorList(string const & action)
{
- if (errorlist_.size()) {
+ if (work_area_->bufferView().getErrorlist().size()) {
string const title = bformat(_("%1$s Errors (%2$s)"),
action, buffer()->fileName());
getDialogs().show("errorlist", title);
- errorlist_.clear();
+ work_area_->bufferView().getErrorlist().clear();
}
}
-ErrorList const & LyXView::getErrorList() const
-{
- return errorlist_;
-}
-
-
void LyXView::showReadonly(bool)
{
updateWindowTitle();
Index: frontends/LyXView.h
===================================================================
--- frontends/LyXView.h (revision 14458)
+++ frontends/LyXView.h (working copy)
@@ -13,8 +13,6 @@
#ifndef LYXVIEW_H
#define LYXVIEW_H
-#include "errorlist.h"
-
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signal.hpp>
@@ -210,9 +208,6 @@
/// dialogs for this view
boost::scoped_ptr<Dialogs> dialogs_;
- /// An error list (replaces the error insets)
- ErrorList errorlist_;
-
/// buffer errors signal connection
boost::signals::connection errorConnection_;
/// buffer messages signal connection