make extender::groups() work without assigning groups to themselves

svn path=/trunk/KDE/kdelibs/; revision=1128236
This commit is contained in:
Marco Martin 2010-05-18 18:55:00 +00:00
parent 6eade776e2
commit 3aee2db14e
3 changed files with 6 additions and 11 deletions

View File

@ -281,11 +281,12 @@ Extender::Appearance Extender::appearance() const
QList<ExtenderGroup*> Extender::groups() const
{
QList<ExtenderGroup*> result;
QList<ExtenderGroup *> result;
foreach (ExtenderItem *item, d->attachedExtenderItems) {
if (item->isGroup() && !result.contains(item->group())) {
if (item->group()) {
result.append(item->group());
ExtenderGroup *group = qobject_cast<ExtenderGroup *>(item);
if (group) {
result.append(group);
}
}
}

View File

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

View File

@ -375,13 +375,8 @@ 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";
}
//nesting extender groups is just insane. I don't think we'd even want to support that.
kWarning() << "Nesting ExtenderGroups is not supported";
return;
}