From 1e234c557ddbe5787b537f14ca383bd16e4e4cd1 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 15 Dec 2009 09:27:15 +0100 Subject: Remove half-implemented optimization Probably fixes QT-2638 --- src/declarative/graphicsitems/qmlgraphicspositioners.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp index 60abdde..b96b8b8 100644 --- a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp +++ b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp @@ -67,10 +67,8 @@ void QmlGraphicsBasePositionerPrivate::watchChanges(QmlGraphicsItem *other) QmlGraphicsItemPrivate *otherPrivate = static_cast(QGraphicsItemPrivate::get(other)); - if(type == QmlGraphicsBasePositioner::Vertical || type == QmlGraphicsBasePositioner::Both) - otherPrivate->connectToHeightChanged(q, prePosIdx); - if(type == QmlGraphicsBasePositioner::Horizontal || type == QmlGraphicsBasePositioner::Both) - otherPrivate->connectToWidthChanged(q, prePosIdx); + otherPrivate->connectToHeightChanged(q, prePosIdx); + otherPrivate->connectToWidthChanged(q, prePosIdx); otherPrivate->registerSiblingOrderNotification(this); watched << other; @@ -83,11 +81,8 @@ void QmlGraphicsBasePositionerPrivate::unwatchChanges(QmlGraphicsItem* other) bool stillAlive = false; //Use the returns from disconnect to see if it was deleted or just reparented stillAlive |= QMetaObject::disconnect(other, visibleIdx, q, prePosIdx); stillAlive |= QMetaObject::disconnect(other, opacityIdx, q, prePosIdx); - //Is disconnect expensive enough to be worth this check? - if(type == QmlGraphicsBasePositioner::Vertical || type == QmlGraphicsBasePositioner::Both) - stillAlive |= otherPrivate->disconnectFromHeightChanged(q, prePosIdx); - if(type == QmlGraphicsBasePositioner::Horizontal || type == QmlGraphicsBasePositioner::Both) - stillAlive |= otherPrivate->disconnectFromWidthChanged(q, prePosIdx); + stillAlive |= otherPrivate->disconnectFromHeightChanged(q, prePosIdx); + stillAlive |= otherPrivate->disconnectFromWidthChanged(q, prePosIdx); if(stillAlive) otherPrivate->unregisterSiblingOrderNotification(this); -- cgit v0.12