diff -r 16d8024aca5e -r f7ac710697a9 src/hbwidgets/itemviews/hblistlayout_p.cpp --- a/src/hbwidgets/itemviews/hblistlayout_p.cpp Mon Apr 19 14:02:13 2010 +0300 +++ b/src/hbwidgets/itemviews/hblistlayout_p.cpp Mon May 03 12:48:33 2010 +0300 @@ -29,10 +29,8 @@ #include "hbwidgetbase.h" #include "hbabstractitemcontainer.h" -#include #include // for QWIDGETSIZE_MAX -#include #include /* @@ -46,7 +44,6 @@ HbListLayoutPrivate::HbListLayoutPrivate(HbListLayout *q_ptr) : q(q_ptr), - mTimer(0), mSmallestItemHeight(INVALID_ITEM_HEIGHT) { } @@ -142,39 +139,6 @@ } /*! - Updates the animation progress. -*/ -void HbListLayoutPrivate::update() -{ - QMapIterator i(mShrinkingItems); - while (i.hasNext()) { - i.next(); - mShrinkingItems[i.key()] = true; - - if (!HbEffect::effectRunning(i.key()->graphicsItem(), "disappear")) { - mShrinkingItems.remove(i.key()); - } - } - - QMapIterator j(mGrowingItems); - while (j.hasNext()) { - j.next(); - mGrowingItems[j.key()] = true; - - if (!HbEffect::effectRunning(j.key()->graphicsItem(), "appear")) { - mGrowingItems.remove(j.key()); - } - } - - q->invalidate(); - - if (mGrowingItems.size() == 0 && mShrinkingItems.size() == 0) { - delete mTimer; - mTimer = 0; - } -} - -/*! Constructor. \param parent parent layout item. */ @@ -192,7 +156,7 @@ HbListLayout::~HbListLayout() { if (d) { - for (int i = count() - 1; i >= 0; --i) { + for (int i = count() - 1; i >= 0; --i) { QGraphicsLayoutItem *item = itemAt(i); // The following lines can be removed, but this removes the item // from the layout more efficiently than the implementation of @@ -237,26 +201,7 @@ */ void HbListLayout::insertItem(int index, QGraphicsLayoutItem *item, bool animate) { - if (animate) { - d->mGrowingItems[item] = false; - if (!d->mTimer) { - d->mTimer = new QTimer(d); - QObject::connect(d->mTimer, SIGNAL(timeout()), d, SLOT(update())); - d->mTimer->start(25); - } - } - - // If some items are shrinking while the item is being inserted, the container's - // item list and the layout's item list may not be at sync. - // The following code block checks if any item *before* the index is shrinking and - // thus not apparent in the container index passed as a parameter. - if (!d->mShrinkingItems.isEmpty()) { - for (int i = 0; i < index; i++) { - if (d->mShrinkingItems.contains(d->mItems.at(i))) { - index++; - } - } - } + Q_UNUSED(animate); index = qMin(index, d->mItems.count()); if (index < 0) { @@ -295,25 +240,10 @@ void HbListLayout::removeItem( QGraphicsLayoutItem *item, bool animate ) { if (animate) { - d->mShrinkingItems[item] = false; - if (d->mGrowingItems.contains(item)) { - d->mShrinkingItems[item] = d->mGrowingItems[item]; - } - - if (!d->mTimer) { - d->mTimer = new QTimer(d); - QObject::connect(d->mTimer, SIGNAL(timeout()), d, SLOT(update())); - d->mTimer->start(25); - } invalidate(); } else { removeAt(indexOf(item)); } - - if (d->mGrowingItems.contains(item)) { - d->mGrowingItems.remove(item); - } - } /*! @@ -366,10 +296,6 @@ d->mItems.removeAt(index); item->setParentLayoutItem(0); invalidate(); - - if (d->mShrinkingItems.contains(item)) { - d->mShrinkingItems.remove(item); - } } } @@ -395,10 +321,6 @@ itemHeight *= item->graphicsItem()->transform().m22(); } - if (d->mGrowingItems.contains(item) && d->mGrowingItems[item] == false) { - itemHeight = 0; - } - QRectF itemRect(effectiveRect.x(), y, effectiveRect.width(), itemHeight); item->setGeometry(itemRect); y += itemHeight; @@ -451,5 +373,3 @@ } -#include "moc_hblistlayout_p_p.cpp" -