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
|
PanelSvg::EnabledBorders PanelSvg::enabledBorders() const
|
||||||
{
|
{
|
||||||
if (d->panels.contains(d->prefix)) {
|
QHash<QString, PanelData*>::const_iterator it = d->panels.constFind(d->prefix);
|
||||||
return d->panels[d->prefix]->enabledBorders;
|
|
||||||
|
if (it != d->panels.constEnd()) {
|
||||||
|
return it.value()->enabledBorders;
|
||||||
} else {
|
} else {
|
||||||
return NoBorder;
|
return NoBorder;
|
||||||
}
|
}
|
||||||
@ -240,8 +242,10 @@ void PanelSvg::resizePanel(const QSizeF& size)
|
|||||||
|
|
||||||
QSizeF PanelSvg::panelSize() const
|
QSizeF PanelSvg::panelSize() const
|
||||||
{
|
{
|
||||||
if (d->panels.contains(d->prefix)) {
|
QHash<QString, PanelData*>::const_iterator it = d->panels.constFind(d->prefix);
|
||||||
return d->panels[d->prefix]->panelSize;
|
|
||||||
|
if (it != d->panels.constEnd()) {
|
||||||
|
return it.value()->panelSize;
|
||||||
} else {
|
} else {
|
||||||
return QSize(-1, -1);
|
return QSize(-1, -1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user