summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxpathview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-08 01:05:24 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-08 01:05:24 (GMT)
commit6b1da53ad4ee4fa9bd60c8c039ba18d386c5e1ad (patch)
tree32e6f7445ad7c22c629196b77b1c5645a02c0525 /src/declarative/fx/qfxpathview.cpp
parentbe0106a92528f7dc47d9fd6e21dd7d7a7ffb9ada (diff)
downloadQt-6b1da53ad4ee4fa9bd60c8c039ba18d386c5e1ad.zip
Qt-6b1da53ad4ee4fa9bd60c8c039ba18d386c5e1ad.tar.gz
Qt-6b1da53ad4ee4fa9bd60c8c039ba18d386c5e1ad.tar.bz2
More path to path fixing.
Diffstat (limited to 'src/declarative/fx/qfxpathview.cpp')
-rw-r--r--src/declarative/fx/qfxpathview.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 2b39d6e..77d5fa2 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -157,7 +157,6 @@ void QFxPathView::setModel(const QVariant &model)
disconnect(d->model, SIGNAL(itemCreated(int, QFxItem*)), this, SLOT(itemCreated(int,QFxItem*)));
for (int i=0; i<d->items.count(); i++){
QFxItem *p = d->items[i];
- attachedProperties.remove(p);
d->model->release(p);
}
d->items.clear();
@@ -557,7 +556,6 @@ void QFxPathViewPrivate::regenerate()
Q_Q(QFxPathView);
for (int i=0; i<items.count(); i++){
QFxItem *p = items[i];
- q->attachedProperties.remove(p);
model->release(p);
}
items.clear();
@@ -631,7 +629,6 @@ void QFxPathView::refill()
while(wrapIndex-- >= 0){
QFxItem* p = d->items.takeFirst();
d->updateItem(p, 0.0);
- attachedProperties.remove(p);
d->model->release(p);
d->firstIndex++;
d->firstIndex %= d->model->count();
@@ -645,7 +642,6 @@ void QFxPathView::refill()
while(wrapIndex++ < d->items.count()-1){
QFxItem* p = d->items.takeLast();
d->updateItem(p, 1.0);
- attachedProperties.remove(p);
d->model->release(p);
d->firstIndex--;
if (d->firstIndex < 0)
@@ -704,7 +700,6 @@ void QFxPathView::itemsRemoved(int modelIndex, int count)
if (d->pathItems == -1) {
for (int i = 0; i < count; ++i) {
QFxItem* p = d->items.takeAt(modelIndex);
- attachedProperties.remove(p);
d->model->release(p);
}
d->snapToCurrent();
@@ -876,8 +871,11 @@ void QFxPathViewPrivate::snapToCurrent()
QHash<QObject*, QObject*> QFxPathView::attachedProperties;
QObject *QFxPathView::qmlAttachedProperties(QObject *obj)
{
- QFxPathViewAttached *rv = new QFxPathViewAttached(obj);
- attachedProperties.insert(obj, rv);
+ QObject *rv = attachedProperties.value(obj);
+ if (!rv) {
+ rv = new QFxPathViewAttached(obj);
+ attachedProperties.insert(obj, rv);
+ }
return rv;
}