~ubuntu-branches/ubuntu/trusty/qtdeclarative-opensource-src/trusty

« back to all changes in this revision

Viewing changes to debian/patches/qtquick_delegate_creation_range_itemviews.patch

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev, Albert Astals Cid
  • Date: 2014-02-18 18:28:19 UTC
  • Revision ID: package-import@ubuntu.com-20140218182819-ao8asl2kczvuwmnb
Tags: 5.0.2-6ubuntu6
[ Albert Astals Cid ]
Improve the delegate range patch (LP: #1281188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
         for (int i = 1; i < visibleItems.count(); ++i) {
26
26
             FxGridItemSG *item = static_cast<FxGridItemSG*>(visibleItems.at(i));
27
27
             if (++col >= columns) {
 
28
@@ -2393,7 +2393,12 @@
 
29
         }
 
30
     } else {
 
31
         int i = 0;
 
32
-        int to = buffer+tempPos+size()-1;
 
33
+        int to = 0;
 
34
+        if (delegateCreationBeginValid && delegateCreationEndValid) {
 
35
+            to = delegateCreationEnd;
 
36
+        } else {
 
37
+            to = buffer+tempPos+size()-1;
 
38
+        }
 
39
         while (i < count && rowPos <= to + rowSize()*(columns - colNum)/qreal(columns+1)) {
 
40
             FxViewItem *item = 0;
 
41
             if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i))))
28
42
--- a/src/quick/items/qquickitemview.cpp
29
43
+++ b/src/quick/items/qquickitemview.cpp
30
44
@@ -699,6 +699,70 @@
563
577
 QTEST_MAIN(tst_QQuickListView)
564
578
 
565
579
 #include "tst_qquicklistview.moc"
 
580
--- a/src/quick/items/qquicklistview.cpp
 
581
+++ b/src/quick/items/qquicklistview.cpp
 
582
@@ -2943,7 +2943,12 @@
 
583
         }
 
584
     } else {
 
585
         int i = 0;
 
586
-        int to = buffer+tempPos+size();
 
587
+        int to = 0;
 
588
+        if (delegateCreationBeginValid && delegateCreationEndValid) {
 
589
+            to = delegateCreationEnd;
 
590
+        } else {
 
591
+            to = buffer+tempPos+size();
 
592
+        }
 
593
         for (i = 0; i < count && pos <= to; ++i) {
 
594
             FxViewItem *item = 0;
 
595
             if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i))))