Merge lp:~timo-jyrinki/kubuntu-packaging/qtdeclarative_fix_crash_when_appending_arrays into lp:~kubuntu-packagers/kubuntu-packaging/qtdeclarative-opensource-src

Proposed by Timo Jyrinki
Status: Merged
Merged at revision: 137
Proposed branch: lp:~timo-jyrinki/kubuntu-packaging/qtdeclarative_fix_crash_when_appending_arrays
Merge into: lp:~kubuntu-packagers/kubuntu-packaging/qtdeclarative-opensource-src
Diff against target: 78 lines (+58/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch (+49/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~timo-jyrinki/kubuntu-packaging/qtdeclarative_fix_crash_when_appending_arrays
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Kubuntu Packagers Pending
Review via email: mp+211025@code.launchpad.net

Commit message

* debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch
  - Backport from upstream https://codereview.qt-project.org/#change,80934
    (LP: #1291602)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The failure does not make sense, since it succeded in archive build running the same tests: https://launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/5.2.1-3ubuntu10

Merging manually.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-03-14 07:56:19 +0000
+++ debian/changelog 2014-03-14 11:06:48 +0000
@@ -1,3 +1,11 @@
1qtdeclarative-opensource-src (5.2.1-3ubuntu10) trusty; urgency=medium
2
3 * debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch
4 - Backport from upstream https://codereview.qt-project.org/#change,80934
5 (LP: #1291602)
6
7 -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Fri, 14 Mar 2014 09:37:56 +0000
8
1qtdeclarative-opensource-src (5.2.1-3ubuntu9) trusty; urgency=medium9qtdeclarative-opensource-src (5.2.1-3ubuntu9) trusty; urgency=medium
210
3 * debian/patches/clean_chain_of_incubated_objects.patch:11 * debian/patches/clean_chain_of_incubated_objects.patch:
412
=== added file 'debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch'
--- debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch 2014-03-14 11:06:48 +0000
@@ -0,0 +1,49 @@
1From 0f771102a59a83a79060e0f200cd6f09ce82ea39 Mon Sep 17 00:00:00 2001
2From: Simon Hausmann <simon.hausmann@digia.com>
3Date: Fri, 14 Mar 2014 10:10:13 +0100
4Subject: [PATCH] Fix crash when appending arrays to sub models in list models
5
6The elements are still inaccessible, but at least it doesn't crash. This is
7consistent with the behavior in Qt 5.0, where it didn't crash because the v8
8object handle returned an empty array for the property names because the
9individual array element wasn't an object.
10
11Bug QTBUG-12117 tracks support for arrays in list models.
12
13Task-number: QTBUG-35891
14Change-Id: Ief446341344977a1473bca474ca5ba934e950468
15---
16 src/qml/types/qqmllistmodel.cpp | 3 +++
17 tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp | 2 ++
18 2 files changed, 5 insertions(+)
19
20diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
21index 37742a3..4a382a1 100644
22--- a/src/qml/types/qqmllistmodel.cpp
23+++ b/src/qml/types/qqmllistmodel.cpp
24@@ -486,6 +486,9 @@ void ListModel::set(int elementIndex, QV4::ObjectRef object, QVector<int> *roles
25
26 void ListModel::set(int elementIndex, QV4::ObjectRef object, QV8Engine *eng)
27 {
28+ if (!object)
29+ return;
30+
31 ListElement *e = elements[elementIndex];
32
33 QV4::ExecutionEngine *v4 = object->engine();
34diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
35index bdc0646..787aa0f 100644
36--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
37+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
38@@ -528,6 +528,8 @@ void tst_qqmllistmodel::dynamic_data()
39 QTest::newRow("nested-count") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.count}" << 3 << "" << dr;
40 QTest::newRow("nested-clear") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.clear(); get(0).bars.count}" << 0 << "" << dr;
41 }
42+
43+ QTest::newRow("jsarray") << "{append({'foo':['1', '2', '3']});get(0).foo.get(0)}" << 0 << "" << false;
44 }
45
46 void tst_qqmllistmodel::dynamic()
47--
481.9.0
49
050
=== modified file 'debian/patches/series'
--- debian/patches/series 2014-03-14 07:55:04 +0000
+++ debian/patches/series 2014-03-14 11:06:48 +0000
@@ -12,3 +12,4 @@
12aarch64.patch12aarch64.patch
13ppc64el.patch13ppc64el.patch
14clean_chain_of_incubated_objects.patch14clean_chain_of_incubated_objects.patch
15Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch

Subscribers

People subscribed via source and target branches