an extender is empty if it doesn't have items or has only group that are empty and autohide
svn path=/trunk/KDE/kdelibs/; revision=1066204
This commit is contained in:
parent
bf438dcf98
commit
8312e39011
@ -732,10 +732,16 @@ void ExtenderPrivate::extenderItemDestroyed(QObject *object)
|
||||
|
||||
bool Extender::isEmpty() const
|
||||
{
|
||||
//If there are no items or only groups, consider this extender empty
|
||||
//It's empty if it doesn't have items or has only group that are empty and autohide
|
||||
foreach (ExtenderItem *item, d->attachedExtenderItems) {
|
||||
if (!item->isGroup()) {
|
||||
return false;
|
||||
} else {
|
||||
//a static_cast here should be safe, it's not the case apparently
|
||||
ExtenderGroup *group = qobject_cast<ExtenderGroup *>(item);
|
||||
if (group && (!group->autoHide() || group->items().size() > 0)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user