[SCM] qtdeclarative packaging branch, ubuntu, updated. debian/5.5.1-2-37-g6f078be

Timo Jyrinki timo at moszumanska.debian.org
Mon Nov 23 07:08:41 UTC 2015


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

The following commit has been merged in the ubuntu branch:
commit 6f078be5d319340fc4ee560e4a95886a76f606f1
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date:   Mon Nov 23 07:08:21 2015 +0000

    Sync with 5.4.2
    
    * debian/patches/Don-t-make-currentIndex-skip-an-extra-item-on-remova.patch:
      - Fix jumping several scopes on unstarring (LP: #1508260)
    * debian/patches/Image-fix-crash-when-switching-between-multiple-scre.patch:
      - Fix a crasher when switching between multiple screens.
---
 debian/changelog                                   |   9 ++
 ...currentIndex-skip-an-extra-item-on-remova.patch | 154 +++++++++++++++++++++
 ...rash-when-switching-between-multiple-scre.patch |  50 +++++++
 debian/patches/series                              |   2 +
 4 files changed, 215 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f5fa9f8..7fce5f7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -101,6 +101,15 @@ qtdeclarative-opensource-src (5.4.2-2) unstable; urgency=medium
 
  -- Lisandro Damián Nicanor Pérez Meyer <lisandro at debian.org>  Tue, 23 Jun 2015 10:40:41 -0300
 
+qtdeclarative-opensource-src (5.4.2-1ubuntu7) xenial; urgency=medium
+
+  * debian/patches/Don-t-make-currentIndex-skip-an-extra-item-on-remova.patch:
+    - Fix jumping several scopes on unstarring (LP: #1508260)
+  * debian/patches/Image-fix-crash-when-switching-between-multiple-scre.patch:
+    - Fix a crasher when switching between multiple screens.
+
+ -- Timo Jyrinki <timo-jyrinki at ubuntu.com>  Fri, 13 Nov 2015 08:06:56 +0000
+
 qtdeclarative-opensource-src (5.4.2-1ubuntu6) wily; urgency=medium
 
   * debian/patches/Fix-memory-leak-when-QQuickPixmapReply-Event-is-dele.patch
diff --git a/debian/patches/Don-t-make-currentIndex-skip-an-extra-item-on-remova.patch b/debian/patches/Don-t-make-currentIndex-skip-an-extra-item-on-remova.patch
new file mode 100644
index 0000000..d3758fa
--- /dev/null
+++ b/debian/patches/Don-t-make-currentIndex-skip-an-extra-item-on-remova.patch
@@ -0,0 +1,154 @@
+From be6e2e10bd608e76a4c910353ce032aea7e6f2df Mon Sep 17 00:00:00 2001
+From: Alberto Mardegan <alberto.mardegan at canonical.com>
+Date: Tue, 10 Nov 2015 15:42:23 +0200
+Subject: [PATCH] Don't make currentIndex skip an extra item on removal
+
+Improve the logic for determining the desired viewport position, which
+got partially broken with 134d980a7fcf61c5440019bcfb3fdfc39c3f5f3c.
+Let's not alter topItem and bottomItem if their index appears to be
+correct.
+
+Task-number: QTBUG-49330
+Change-Id: Ib1c88de51be28cbb0afb1741440adb03ae8ebd87
+---
+ src/quick/items/qquickgridview.cpp                 |  4 +--
+ src/quick/items/qquicklistview.cpp                 |  4 +--
+ .../snapOneItemCurrentIndexRemoveAnimation.qml     | 39 ++++++++++++++++++++++
+ .../quick/qquicklistview/tst_qquicklistview.cpp    | 27 +++++++++++++++
+ 4 files changed, 70 insertions(+), 4 deletions(-)
+ create mode 100644 tests/auto/quick/qquicklistview/data/snapOneItemCurrentIndexRemoveAnimation.qml
+
+diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
+index 3ac9c6e..65d7362 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 (strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem && (!topItem || topItem->index != currentIndex)) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             topItem = currentItem;
+         }
+         FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd);
+-        if (strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem && (!bottomItem || bottomItem->index != currentIndex)) {
+             // 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 2958c0a..0211e9f 100644
+--- a/src/quick/items/qquicklistview.cpp
++++ b/src/quick/items/qquicklistview.cpp
+@@ -1479,13 +1479,13 @@ void QQuickListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte
+             tempPosition -= bias;
+         }
+         FxViewItem *topItem = snapItemAt(tempPosition+highlightRangeStart);
+-        if (strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem && (!topItem || topItem->index != currentIndex)) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             topItem = currentItem;
+         }
+         FxViewItem *bottomItem = snapItemAt(tempPosition+highlightRangeEnd);
+-        if (strictHighlightRange && currentItem) {
++        if (strictHighlightRange && currentItem && (!bottomItem || bottomItem->index != currentIndex)) {
+             // StrictlyEnforceRange always keeps an item in range
+             updateHighlight();
+             bottomItem = currentItem;
+diff --git a/tests/auto/quick/qquicklistview/data/snapOneItemCurrentIndexRemoveAnimation.qml b/tests/auto/quick/qquicklistview/data/snapOneItemCurrentIndexRemoveAnimation.qml
+new file mode 100644
+index 0000000..215467f
+--- /dev/null
++++ b/tests/auto/quick/qquicklistview/data/snapOneItemCurrentIndexRemoveAnimation.qml
+@@ -0,0 +1,39 @@
++import QtQuick 2.4
++
++ListView {
++    id: root
++    height: 400
++    width: height
++    model: ListModel {
++        id: lmodel
++        ListElement { dummy: 0 }
++        ListElement { dummy: 0 }
++        ListElement { dummy: 0 }
++        ListElement { dummy: 0 }
++        ListElement { dummy: 0 }
++        ListElement { dummy: 0 }
++    }
++
++    function removeItemZero()
++    {
++        lmodel.remove(0);
++    }
++
++    orientation: ListView.Horizontal
++    snapMode: ListView.SnapOneItem
++    highlightRangeMode: ListView.StrictlyEnforceRange
++
++    property int transitionsRun: 0
++
++    removeDisplaced: Transition {
++        id: transition
++        PropertyAnimation { property: "x"; duration: 500 }
++        onRunningChanged: if (!running) transitionsRun++;
++    }
++
++    delegate: Text {
++        text: index + " of " + lmodel.count
++        width: root.width
++        height: root.height
++    }
++}
+\ No newline at end of file
+diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+index e02c053..a5de266 100644
+--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
++++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+@@ -182,6 +182,7 @@ private slots:
+     void snapOneItemResize_QTBUG_43555();
+     void snapOneItem_data();
+     void snapOneItem();
++    void snapOneItemCurrentIndexRemoveAnimation();
+ 
+     void QTBUG_9791();
+     void QTBUG_11105();
+@@ -5587,6 +5588,32 @@ void tst_QQuickListView::snapOneItem()
+     releaseView(window);
+ }
+ 
++void tst_QQuickListView::snapOneItemCurrentIndexRemoveAnimation()
++{
++    QQuickView *window = createView();
++
++    window->setSource(testFileUrl("snapOneItemCurrentIndexRemoveAnimation.qml"));
++    window->show();
++    QVERIFY(QTest::qWaitForWindowExposed(window));
++
++    QQuickListView *listview = qobject_cast<QQuickListView*>(window->rootObject());
++    QTRY_VERIFY(listview != 0);
++
++    QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
++    QTRY_COMPARE(listview->currentIndex(), 0);
++    QSignalSpy currentIndexSpy(listview, SIGNAL(currentIndexChanged()));
++
++    QMetaObject::invokeMethod(window->rootObject(), "removeItemZero");
++    QTRY_COMPARE(listview->property("transitionsRun").toInt(), 1);
++
++    QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
++
++    QCOMPARE(listview->currentIndex(), 0);
++    QCOMPARE(currentIndexSpy.count(), 0);
++
++    delete window;
++}
++
+ void tst_QQuickListView::attachedProperties_QTBUG_32836()
+ {
+     QQuickView *window = createView();
+-- 
+2.6.2
+
diff --git a/debian/patches/Image-fix-crash-when-switching-between-multiple-scre.patch b/debian/patches/Image-fix-crash-when-switching-between-multiple-scre.patch
new file mode 100644
index 0000000..be0c91a
--- /dev/null
+++ b/debian/patches/Image-fix-crash-when-switching-between-multiple-scre.patch
@@ -0,0 +1,50 @@
+From 5f23d4eb103baa21225adb4c3dd666dbefef6515 Mon Sep 17 00:00:00 2001
+From: Mitch Curtis <mitch.curtis at theqtcompany.com>
+Date: Thu, 24 Sep 2015 10:05:37 +0200
+Subject: [PATCH] Image: fix crash when switching between multiple screens
+
+When moving a Qt Quick application containing Image delegates in a view
+(e.g. ListView, GridView, etc.) between multiple screens, it's possible
+that the amount of visible delegates changes due to potential
+differences in the screens' sizes.
+
+For example, moving an application using the Window + left/right arrow
+keys on Windows causes the window to snap to the side of the screen.
+If one screen is smaller than the other, moving the application back
+and forth in this manner will cause some delegates to be destroyed, as
+they are no longer visible in the smaller screen.
+
+However, between receiving the Component.destruction signal in QML and
+being actually destroyed in C++, the Images may try to reload their
+pixmaps (when the cache property is set to false, for example). Since
+the views had (correctly) already hidden those delegates and hence
+they had no associated QQmlEngine, the load() function would crash
+because of the assumption that there was a valid engine.
+
+This patch checks that there is a valid QQmlEngine with which to load
+pixmaps before doing so.
+
+Change-Id: I8a3f0ec5220fddfd79758985c1eb2b55b0baae47
+Task-number: QTBUG-45991
+Reviewed-by: Gunnar Sletta <gunnar at sletta.org>
+Reviewed-by: Simon Hausmann <simon.hausmann at theqtcompany.com>
+---
+ src/quick/items/qquickimagebase.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp
+index 223cb8f..7232524 100644
+--- a/src/quick/items/qquickimagebase.cpp
++++ b/src/quick/items/qquickimagebase.cpp
+@@ -308,7 +308,7 @@ void QQuickImageBase::itemChange(ItemChange change, const ItemChangeData &value)
+ void QQuickImageBase::handleScreenChanged(QScreen* screen)
+ {
+     // Screen DPI might have changed, reload images on screen change.
+-    if (screen && isComponentComplete())
++    if (qmlEngine(this) && screen && isComponentComplete())
+         load();
+ }
+ 
+-- 
+2.6.2
+
diff --git a/debian/patches/series b/debian/patches/series
index 0037ba8..542d660 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,6 +4,8 @@ Add-QQuickAsyncImageProvider.patch
 Don-t-change-the-currentItem-after-a-viewport-resize.patch
 Fix-memory-leak-when-using-async-image-providers.patch
 qmlplugindump-Don-t-try-to-import-Qt.test.qtestroot.patch
+Don-t-make-currentIndex-skip-an-extra-item-on-remova.patch
+Image-fix-crash-when-switching-between-multiple-scre.patch
 
 # Debian patches
 check_system_double-conversion.patch

-- 
qtdeclarative packaging



More information about the pkg-kde-commits mailing list