-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
This commit is contained in:
Marco Martin 2010-05-18 09:28:06 +00:00
parent aca321d765
commit f26246c731
2 changed files with 10 additions and 3 deletions

View File

@ -98,6 +98,8 @@ ExtenderGroup::ExtenderGroup(Extender *parent, uint groupId)
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()),
this, SLOT(themeChanged()));
setGroup(this);
}
ExtenderGroup::~ExtenderGroup()

View File

@ -375,8 +375,13 @@ void ExtenderItem::setGroup(ExtenderGroup *group)
void ExtenderItem::setGroup(ExtenderGroup *group, const QPointF &pos)
{
if (isGroup()) {
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<const Plasma::ExtenderGroup *>(this));
}
bool ExtenderItem::isCollapsed() const