[SCM] qtdeclarative packaging branch, ubuntu, updated. ubuntu/5.4.2-1ubuntu2-19-ge82be73

Timo Jyrinki timo at moszumanska.debian.org
Thu Aug 20 10:50:39 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtdeclarative.git;a=commitdiff;h=c4b43fe

The following commit has been merged in the ubuntu branch:
commit c4b43fe46f330d65919d8f5112d1267a92aaf9d4
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date:   Thu Aug 20 10:48:49 2015 +0000

    debian/patches/Don-t-change-the-currentItem-after-a-viewport-resize.patch:
    
    * debian/patches/Don-t-change-the-currentItem-after-a-viewport-resize.patch:
      - Fix ListView's currentIndex changing when view is resized (LP: #1433442)
---
 debian/changelog                                   |   7 ++
 ...e-the-currentItem-after-a-viewport-resize.patch | 140 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 3 files changed, 148 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3966728..34e6309 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,13 @@ qtdeclarative-opensource-src (5.5.0-0ubuntu1) UNRELEASED; urgency=medium
 
  -- Timo Jyrinki <timo-jyrinki at ubuntu.com>  Thu, 09 Jul 2015 11:02:34 +0000
 
+qtdeclarative-opensource-src (5.4.2-1ubuntu5) wily; urgency=medium
+
+  * debian/patches/Don-t-change-the-currentItem-after-a-viewport-resize.patch:
+    - Fix ListView's currentIndex changing when view is resized (LP: #1433442)
+
+ -- Timo Jyrinki <timo-jyrinki at ubuntu.com>  Thu, 13 Aug 2015 12:30:49 +0300
+
 qtdeclarative-opensource-src (5.4.2-1ubuntu4) wily; urgency=medium
 
   * Rebuild for GCC5 transition.
diff --git a/debian/patches/Don-t-change-the-currentItem-after-a-viewport-resize.patch b/debian/patches/Don-t-change-the-currentItem-after-a-viewport-resize.patch
new file mode 100644
index 0000000..1d5da8d
--- /dev/null
+++ b/debian/patches/Don-t-change-the-currentItem-after-a-viewport-resize.patch
@@ -0,0 +1,140 @@
+From 134d980a7fcf61c5440019bcfb3fdfc39c3f5f3c Mon Sep 17 00:00:00 2001
+From: Alberto Mardegan <info at mardy.it>
+Date: Sat, 11 Jul 2015 15:24:53 +0300
+Subject: [PATCH] Don't change the currentItem after a viewport resize
+
+When highlightRangeMode is set to StrictlyEnforceRange and the view gets
+resized, we don't want the currentIndex to change.
+
+The code touched by this patch was introduced by commit
+I08b7e61496a79f71c3b40fafaca985ae90f88503 back in Qt 4.7 times, and
+never changed since then.
+
+Task-number: QTBUG-43555
+Change-Id: Ie67faa6898f13a1f7b0f1c4ae6c29721cb7dfa41
+Reviewed-by: J-P Nurmi <jpnurmi at theqtcompany.com>
+Reviewed-by: Michael Brasser <michael.brasser at live.com>
+Reviewed-by: Alan Alpert <aalpert at blackberry.com>
+---
+ src/quick/items/qquickgridview.cpp                 |  4 +--
+ src/quick/items/qquicklistview.cpp                 |  4 +--
+ .../qquicklistview/data/snapOneItemResize.qml      | 16 +++++++++++
+ .../quick/qquicklistview/tst_qquicklistview.cpp    | 32 ++++++++++++++++++++++
+ 4 files changed, 52 insertions(+), 4 deletions(-)
+ create mode 100644 tests/auto/quick/qquicklistview/data/snapOneItemResize.qml
+
+diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
+index e3f216b..ff928a5 100644
+--- a/src/quick/items/qquickgridview.cpp
++++ b/src/quick/items/qquickgridview.cpp
+@@ -922,13 +922,13 @@ void QQuickGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte
+             tempPosition -= bias;
+         }
+         FxViewItem *topItem = snapItemAt(tempPosition+highlightRangeStart);
+-        if (!topItem && strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             topItem = currentItem;
+         }
+         FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd);
+-        if (!bottomItem && strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             bottomItem = currentItem;
+diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
+index e37aca0..b08a8cf 100644
+--- a/src/quick/items/qquicklistview.cpp
++++ b/src/quick/items/qquicklistview.cpp
+@@ -1470,13 +1470,13 @@ void QQuickListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte
+             tempPosition -= bias;
+         }
+         FxViewItem *topItem = snapItemAt(tempPosition+highlightRangeStart);
+-        if (!topItem && strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             topItem = currentItem;
+         }
+         FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd);
+-        if (!bottomItem && strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             bottomItem = currentItem;
+diff --git a/tests/auto/quick/qquicklistview/data/snapOneItemResize.qml b/tests/auto/quick/qquicklistview/data/snapOneItemResize.qml
+new file mode 100644
+index 0000000..7ecc833
+--- /dev/null
++++ b/tests/auto/quick/qquicklistview/data/snapOneItemResize.qml
+@@ -0,0 +1,16 @@
++import QtQuick 2.0
++
++ListView {
++    id: list
++    currentIndex: 5
++    snapMode: ListView.SnapOneItem
++    orientation: ListView.Horizontal
++    highlightRangeMode: ListView.StrictlyEnforceRange
++    highlightFollowsCurrentItem: true
++    model: 10
++    spacing: 10
++    delegate: Item {
++        width: ListView.view.width
++        height: ListView.view.height
++    }
++}
+diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+index 6377650..0c0e911 100644
+--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
++++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+@@ -179,6 +179,7 @@ private slots:
+     void creationContext();
+     void snapToItem_data();
+     void snapToItem();
++    void snapOneItemResize_QTBUG_43555();
+     void snapOneItem_data();
+     void snapOneItem();
+ 
+@@ -5203,6 +5204,37 @@ void tst_QQuickListView::snapToItem()
+     releaseView(window);
+ }
+ 
++void tst_QQuickListView::snapOneItemResize_QTBUG_43555()
++{
++    QQuickView *window = createView();
++    window->resize(QSize(100, 320));
++    window->setResizeMode(QQuickView::SizeRootObjectToView);
++    QQuickViewTestUtil::moveMouseAway(window);
++
++    window->setSource(testFileUrl("snapOneItemResize.qml"));
++    window->show();
++    QVERIFY(QTest::qWaitForWindowExposed(window));
++
++    QQuickListView *listview = qobject_cast<QQuickListView*>(window->rootObject());
++    QTRY_VERIFY(listview != 0);
++
++    QSignalSpy currentIndexSpy(listview, SIGNAL(currentIndexChanged()));
++
++    QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
++    QTRY_COMPARE(listview->currentIndex(), 5);
++    currentIndexSpy.clear();
++
++    window->resize(QSize(400, 320));
++
++    QTRY_COMPARE(int(listview->width()), 400);
++    QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
++
++    QTRY_COMPARE(listview->currentIndex(), 5);
++    QCOMPARE(currentIndexSpy.count(), 0);
++
++    delete window;
++}
++
+ void tst_QQuickListView::qAbstractItemModel_package_items()
+ {
+     items<QaimModel>(testFileUrl("listviewtest-package.qml"));
+-- 
+2.5.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 0ccbf21..e6c402a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ disable_failing_tests.patch
 QML-Compilation-unit-caching-and-JIT-changes.patch
 Make-sure-we-stop-animators-if-they-are-yet-to-be-st.patch
 Add-QQuickAsyncImageProvider.patch
+Don-t-change-the-currentItem-after-a-viewport-resize.patch

-- 
qtdeclarative packaging



More information about the pkg-kde-commits mailing list