This almost fix the performance issue when zooming out on plasma-desktop.

We don't need to call prepareGeometryChange if the geometry will not
change, this mistake end up with a new paint event that will paint for
nothing.

This should be backported into 4.3

svn path=/trunk/KDE/kdelibs/; revision=997763
This commit is contained in:
Alexis Ménard 2009-07-16 13:09:19 +00:00
parent b73625fbfc
commit d4ca38b20f
3 changed files with 5 additions and 5 deletions

View File

@ -108,6 +108,8 @@ class EmptyGraphicsItem : public QGraphicsItem
void setRect(const QRectF &rect)
{
if (m_rect == rect)
return;
//kDebug() << "setting rect to" << rect;
prepareGeometryChange();
m_rect = rect;
@ -510,9 +512,8 @@ void DesktopToolBox::showToolBox()
{
setFlag(ItemIgnoresTransformations, isToolbar());
if (showing() && !isToolbar()) {
if (showing() && !isToolbar())
return;
}
// put tools 5px from icon edge
const int iconWidth = KIconLoader::SizeMedium;
@ -696,7 +697,6 @@ void DesktopToolBox::showToolBox()
}
}
d->toolBacker->setRect(backerRect);
d->toolBacker->show();

View File

@ -362,7 +362,7 @@ QTransform ToolBox::viewTransform() const
return d->viewTransform;
}
void ToolBox::setViewTransform(QTransform transform)
void ToolBox::setViewTransform(const QTransform &transform)
{
if (transform.isScaling()) {
d->toolbar = true;

View File

@ -84,7 +84,7 @@ public:
void setIsToolbar(bool toolbar);
QTransform viewTransform() const;
void setViewTransform(QTransform transforn);
void setViewTransform(const QTransform &transform);
void save(KConfigGroup &cg) const;
void load(const KConfigGroup &containmentGroup = KConfigGroup());