From b0ddc4362d0f66b3738d957a052480ab3804247a Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sat, 10 Nov 2007 23:16:32 +0000 Subject: [PATCH] KRUSH: we actually want to set the parent's layout in the Layout ctor, not the BoxLayout. handing out books on OOD seems like a good idea at this point. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=735120 --- widgets/boxlayout.cpp | 4 ---- widgets/layout.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/widgets/boxlayout.cpp b/widgets/boxlayout.cpp index 06cbfa034..dd664dba2 100644 --- a/widgets/boxlayout.cpp +++ b/widgets/boxlayout.cpp @@ -249,10 +249,6 @@ BoxLayout::BoxLayout(Direction direction , LayoutItem *parent) : Layout(parent), d(new Private(this)) { - if (parent) { - parent->setLayout(this); - } - d->direction = direction; } diff --git a/widgets/layout.cpp b/widgets/layout.cpp index 05aa30db6..ccb2de2ed 100644 --- a/widgets/layout.cpp +++ b/widgets/layout.cpp @@ -35,10 +35,10 @@ namespace Plasma class Layout::Private { public: - Private(LayoutItem* parent) + Private(LayoutItem* p) : margin(12.0), spacing(6.0), - parent(parent), + parent(p), animator(0) { } @@ -57,6 +57,9 @@ Layout::Layout(LayoutItem *parent) : LayoutItem(), d(new Private(parent)) { + if (parent) { + parent->setLayout(this); + } } void Layout::setParent(LayoutItem *parent) {