diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-09-22 14:34:57 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-22 07:22:13 +0200 |
commit | e05387b63397f8b19b8cd6ee4f325945bbc1d8d5 (patch) | |
tree | ab29fb0745b4bea269d4f0d3612e3e92cb4ff967 /src | |
parent | 852983a6d9dc5d57753d6eadf779d6607497ac64 (diff) |
Constrain while loop on item count
pos won't necessarily change, but item count does like in the above loop
Task-number: QTBUG-21315
Change-Id: Iaedabeacf4ebe3cd0505193395047b3d65a09442
Reviewed-on: http://codereview.qt-project.org/5347
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/items/qsgpathview.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/items/qsgpathview.cpp b/src/declarative/items/qsgpathview.cpp index a1038ad5e5..10161e50c1 100644 --- a/src/declarative/items/qsgpathview.cpp +++ b/src/declarative/items/qsgpathview.cpp @@ -1367,7 +1367,7 @@ void QSGPathView::refill() } ++it; } else { -// qDebug() << "release"; + // qDebug() << "release"; d->updateItem(item, 1.0); d->releaseItem(item); if (it == d->items.begin()) { @@ -1397,7 +1397,7 @@ void QSGPathView::refill() } qreal pos = d->positionOfIndex(idx); while ((pos > startPos || !d->items.count()) && d->items.count() < count) { - // qDebug() << "append" << idx; + // qDebug() << "append" << idx; QSGItem *item = d->getItem(idx); if (d->model->completePending()) item->setZ(idx+1); @@ -1421,8 +1421,8 @@ void QSGPathView::refill() if (idx < 0) idx = d->modelCount - 1; pos = d->positionOfIndex(idx); - while (pos >= 0.0 && pos < startPos) { - // qDebug() << "prepend" << idx; + while ((pos >= 0.0 && pos < startPos) && d->items.count() < count) { + // qDebug() << "prepend" << idx; QSGItem *item = d->getItem(idx); if (d->model->completePending()) item->setZ(idx+1); |