From f26246c731e090313e5cd036775a4b83aa2edfde Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 18 May 2010 09:28:06 +0000 Subject: [PATCH] -groups of groups are always themselves, this fixes extender::groups() -extra check a group is actually an extendergroup type svn path=/trunk/KDE/kdelibs/; revision=1128074 --- extenders/extendergroup.cpp | 2 ++ extenders/extenderitem.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/extenders/extendergroup.cpp b/extenders/extendergroup.cpp index 9a4a8fb49..7395bbed1 100644 --- a/extenders/extendergroup.cpp +++ b/extenders/extendergroup.cpp @@ -98,6 +98,8 @@ ExtenderGroup::ExtenderGroup(Extender *parent, uint groupId) connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(themeChanged())); + + setGroup(this); } ExtenderGroup::~ExtenderGroup() diff --git a/extenders/extenderitem.cpp b/extenders/extenderitem.cpp index 0ef47b922..832910b3f 100644 --- a/extenders/extenderitem.cpp +++ b/extenders/extenderitem.cpp @@ -375,8 +375,13 @@ void ExtenderItem::setGroup(ExtenderGroup *group) void ExtenderItem::setGroup(ExtenderGroup *group, const QPointF &pos) { if (isGroup()) { - //nesting extender groups is just insane. I don't think we'd even want to support that. - kWarning() << "Nesting ExtenderGroups is not supported"; + if (group == this) { + //a group of a group is always just itself + d->group = group; + } else { + //nesting extender groups is just insane. I don't think we'd even want to support that. + kWarning() << "Nesting ExtenderGroups is not supported"; + } return; } @@ -406,7 +411,7 @@ ExtenderGroup *ExtenderItem::group() const bool ExtenderItem::isGroup() const { - return (config().readEntry("isGroup", false)); + return (config().readEntry("isGroup", false) && qobject_cast(this)); } bool ExtenderItem::isCollapsed() const