From 7215b099d359d9e8a1834a0dd37109dac1ed0c37 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 14 Aug 2009 22:47:57 +0000 Subject: [PATCH] Remove GuiToolbar * member from the LayoutBox ctor: Why should we limit a LayoutBox to the Toolbar and it doesn't even have to know where it is. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31041 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiToolbar.cpp | 2 ++ src/frontends/qt4/LayoutBox.cpp | 5 +---- src/frontends/qt4/LayoutBox.h | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index b813d4647f..3d5722c75e 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -228,6 +228,8 @@ void GuiToolbar::add(ToolbarItem const & item) break; case ToolbarItem::LAYOUTS: layout_ = new LayoutBox(this, owner_); + QObject::connect(this, SIGNAL(iconSizeChanged(QSize)), + layout_, SLOT(setIconSize(QSize))); addWidget(layout_); break; case ToolbarItem::MINIBUFFER: diff --git a/src/frontends/qt4/LayoutBox.cpp b/src/frontends/qt4/LayoutBox.cpp index 212b484aec..27e19c4dbb 100644 --- a/src/frontends/qt4/LayoutBox.cpp +++ b/src/frontends/qt4/LayoutBox.cpp @@ -45,7 +45,6 @@ #include #include #include -#include using namespace std; using namespace lyx::support; @@ -398,7 +397,7 @@ void LayoutBox::Private::setFilter(QString const & s) } -LayoutBox::LayoutBox(QToolBar * bar, GuiView & owner) +LayoutBox::LayoutBox(GuiView & owner) : d(new Private(this, owner)) { setSizeAdjustPolicy(QComboBox::AdjustToContents); @@ -414,8 +413,6 @@ LayoutBox::LayoutBox(QToolBar * bar, GuiView & owner) QObject::connect(this, SIGNAL(activated(int)), this, SLOT(selected(int))); - QObject::connect(bar, SIGNAL(iconSizeChanged(QSize)), - this, SLOT(setIconSize(QSize))); d->owner_.setLayoutDialog(this); updateContents(true); diff --git a/src/frontends/qt4/LayoutBox.h b/src/frontends/qt4/LayoutBox.h index e520e3c0a8..493f931d1b 100644 --- a/src/frontends/qt4/LayoutBox.h +++ b/src/frontends/qt4/LayoutBox.h @@ -20,8 +20,6 @@ #include -class QToolBar; - namespace lyx { class DocumentClass; @@ -36,7 +34,7 @@ class LayoutBox : public QComboBox { Q_OBJECT public: - LayoutBox(QToolBar *, GuiView &); + LayoutBox(GuiView &); /// select the right layout in the combobox. void set(docstring const & layout);