smarter use of QMap
svn path=/trunk/KDE/kdelibs/; revision=895574
This commit is contained in:
parent
2a8e07ba42
commit
87fb3dfabe
@ -305,18 +305,14 @@ void ExtenderItem::addAction(const QString &name, QAction *action)
|
|||||||
{
|
{
|
||||||
Q_ASSERT(action);
|
Q_ASSERT(action);
|
||||||
|
|
||||||
d->actions[name] = action;
|
d->actions.insert(name, action);
|
||||||
connect(action, SIGNAL(changed()), this, SLOT(updateToolBox()));
|
connect(action, SIGNAL(changed()), this, SLOT(updateToolBox()));
|
||||||
d->updateToolBox();
|
d->updateToolBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *ExtenderItem::action(const QString &name) const
|
QAction *ExtenderItem::action(const QString &name) const
|
||||||
{
|
{
|
||||||
if (d->actions.contains(name)) {
|
return d->actions.value(name, 0);
|
||||||
return d->actions[name];
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtenderItem::showCloseButton()
|
void ExtenderItem::showCloseButton()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user