From c7d83abbacbb2fb4ecfddebe7efc189f9f1a3625 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 23 Aug 2007 13:20:01 +0000 Subject: [PATCH] Put LyXView on a diet, step 2: Transfer ControlCommandBuffer handling from LyXView to QCommandBuffer. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19753 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/LyXView.cpp | 4 +--- src/frontends/LyXView.h | 9 --------- src/frontends/qt4/GuiView.cpp | 2 +- src/frontends/qt4/QCommandBuffer.cpp | 6 ++---- src/frontends/qt4/QCommandBuffer.h | 7 ++++--- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/frontends/LyXView.cpp b/src/frontends/LyXView.cpp index c0be8e9f34..28a2133b18 100644 --- a/src/frontends/LyXView.cpp +++ b/src/frontends/LyXView.cpp @@ -38,8 +38,6 @@ #include "MenuBackend.h" #include "Paragraph.h" -#include "controllers/ControlCommandBuffer.h" - #include "support/lstrings.h" #include "support/filetools.h" // OnlyFilename() #include "support/Timeout.h" @@ -72,7 +70,7 @@ LyXView::LyXView(int id) : toolbars_(new Toolbars(*this)), autosave_timeout_(new Timeout(5000)), dialogs_(new Dialogs(*this)), - controlcommand_(new ControlCommandBuffer(*this)), id_(id) + id_(id) { // Start autosave timer if (lyxrc.autosave) { diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 19ff3d4751..e275436981 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -39,7 +39,6 @@ class Timeout; namespace frontend { -class ControlCommandBuffer; class Dialogs; class WorkArea; @@ -257,14 +256,6 @@ protected: /// void updateToc(); - /// view's command buffer controller - // this has to be declared _after_ lyxfunc_ as its initialization depends - // on it! - typedef boost::scoped_ptr - CommandBufferPtr; - - CommandBufferPtr const controlcommand_; - private: int id_; }; diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 473814870f..2ea2b88fbf 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -572,7 +572,7 @@ void GuiView::setWindowTitle(docstring const & t, docstring const & it) void GuiView::addCommandBuffer(QToolBar * toolbar) { - commandbuffer_ = new QCommandBuffer(this, *controlcommand_); + commandbuffer_ = new QCommandBuffer(this); toolbar->addWidget(commandbuffer_); } diff --git a/src/frontends/qt4/QCommandBuffer.cpp b/src/frontends/qt4/QCommandBuffer.cpp index faba90d947..edfb12b1a0 100644 --- a/src/frontends/qt4/QCommandBuffer.cpp +++ b/src/frontends/qt4/QCommandBuffer.cpp @@ -18,8 +18,6 @@ #include "QCommandEdit.h" #include "qt_helpers.h" -#include "controllers/ControlCommandBuffer.h" - #include "support/filetools.h" #include @@ -77,8 +75,8 @@ protected: } // end of anon -QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control) - : view_(view), controller_(control) +QCommandBuffer::QCommandBuffer(GuiView * view) + : view_(view), controller_(*view) { QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm").absFilename())); QPixmap qpdown(toqstr(libFileSearch("images", "down", "xpm").absFilename())); diff --git a/src/frontends/qt4/QCommandBuffer.h b/src/frontends/qt4/QCommandBuffer.h index 9304783e85..14dd5ee8f8 100644 --- a/src/frontends/qt4/QCommandBuffer.h +++ b/src/frontends/qt4/QCommandBuffer.h @@ -12,6 +12,8 @@ #ifndef QCOMMANDBUFFER_H #define QCOMMANDBUFFER_H +#include "controllers/ControlCommandBuffer.h" + #include class QListWidgetItem; @@ -21,12 +23,11 @@ namespace frontend { class QCommandEdit; class GuiView; -class ControlCommandBuffer; class QCommandBuffer : public QWidget { Q_OBJECT public: - QCommandBuffer(GuiView * view, ControlCommandBuffer & control); + QCommandBuffer(GuiView * view); /// focus the edit widget void focus_command(); @@ -50,7 +51,7 @@ private: GuiView * view_; /// controller - ControlCommandBuffer & controller_; + ControlCommandBuffer controller_; /// command widget QCommandEdit * edit_;