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

Subscribers

People subscribed via source and target branches