use iterators to avoid two searches
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803659
This commit is contained in:
parent
94517b3f87
commit
899260cc23
12
panelsvg.cpp
12
panelsvg.cpp
@ -129,8 +129,10 @@ void PanelSvg::setEnabledBorders(const EnabledBorders borders)
|
||||
|
||||
PanelSvg::EnabledBorders PanelSvg::enabledBorders() const
|
||||
{
|
||||
if (d->panels.contains(d->prefix)) {
|
||||
return d->panels[d->prefix]->enabledBorders;
|
||||
QHash<QString, PanelData*>::const_iterator it = d->panels.constFind(d->prefix);
|
||||
|
||||
if (it != d->panels.constEnd()) {
|
||||
return it.value()->enabledBorders;
|
||||
} else {
|
||||
return NoBorder;
|
||||
}
|
||||
@ -240,8 +242,10 @@ void PanelSvg::resizePanel(const QSizeF& size)
|
||||
|
||||
QSizeF PanelSvg::panelSize() const
|
||||
{
|
||||
if (d->panels.contains(d->prefix)) {
|
||||
return d->panels[d->prefix]->panelSize;
|
||||
QHash<QString, PanelData*>::const_iterator it = d->panels.constFind(d->prefix);
|
||||
|
||||
if (it != d->panels.constEnd()) {
|
||||
return it.value()->panelSize;
|
||||
} else {
|
||||
return QSize(-1, -1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user