[SCM] qtdeclarative packaging branch, ubuntu+1, updated. ubuntu/5.6.1-4ubuntu2-2-g0bd2904

Timo Jyrinki timo at moszumanska.debian.org
Mon Aug 22 13:32:29 UTC 2016


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

The following commit has been merged in the ubuntu+1 branch:
commit d454a45110194fe165e67f10fda75f1f372dd906
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date:   Mon Aug 22 13:31:18 2016 +0000

    debian/patches/Fix-visibility-of-properties-in-value-types.patch:
    
    * debian/patches/Fix-visibility-of-properties-in-value-types.patch:
      - Fix compare() in QML (LP: #1610349)
---
 debian/changelog                                   |   7 ++
 ...x-visibility-of-properties-in-value-types.patch | 128 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 3 files changed, 136 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 22eca5e..f2b9a33 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+qtdeclarative-opensource-src (5.6.1-4ubuntu3) UNRELEASED; urgency=medium
+
+  * debian/patches/Fix-visibility-of-properties-in-value-types.patch:
+    - Fix compare() in QML (LP: #1610349)
+
+ -- Timo Jyrinki <timo-jyrinki at ubuntu.com>  Fri, 12 Aug 2016 11:53:06 +0000
+
 qtdeclarative-opensource-src (5.6.1-4ubuntu2) yakkety; urgency=medium
 
   * debian/patches/Flickable-fix-minXExtent-minYExtent-when-content-is-.patch:
diff --git a/debian/patches/Fix-visibility-of-properties-in-value-types.patch b/debian/patches/Fix-visibility-of-properties-in-value-types.patch
new file mode 100644
index 0000000..7e505c7
--- /dev/null
+++ b/debian/patches/Fix-visibility-of-properties-in-value-types.patch
@@ -0,0 +1,128 @@
+From 1c51ae2911636e61a698967fd9c6aabd28f5ceb9 Mon Sep 17 00:00:00 2001
+From: Simon Hausmann <simon.hausmann at theqtcompany.com>
+Date: Thu, 12 May 2016 10:19:14 +0200
+Subject: [PATCH] Fix visibility of properties in value types
+
+It should be possible to enumerate the properties of value types (gadgets),
+in order for things like JSON.stringify(Qt.point(10, 20)) to return something
+sensible.
+
+Task-number: QTBUG-43382
+Task-number: QTBUG-34878
+Change-Id: I3a2c09151ebe97fd97760dfbbf5a4f58e022bc94
+Reviewed-by: Mitch Curtis <mitch.curtis at qt.io>
+Reviewed-by: Robin Burchell <robin.burchell at viroteck.net>
+---
+ src/qml/qml/qqmlvaluetypewrapper.cpp               | 29 ++++++++++++++++++++++
+ src/qml/qml/qqmlvaluetypewrapper_p.h               |  1 +
+ .../auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 21 ++++++++++++++++
+ 3 files changed, 51 insertions(+)
+
+diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
+index 96bca90..fdac41a 100644
+--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
++++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
+@@ -50,6 +50,7 @@
+ #include <private/qv4functionobject_p.h>
+ #include <private/qv4variantobject_p.h>
+ #include <private/qv4alloca_p.h>
++#include <private/qv4objectiterator_p.h>
+ 
+ QT_BEGIN_NAMESPACE
+ 
+@@ -244,6 +245,34 @@ PropertyAttributes QQmlValueTypeWrapper::query(const Managed *m, String *name)
+     return result ? Attr_Data : Attr_Invalid;
+ }
+ 
++void QQmlValueTypeWrapper::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)
++{
++    name->setM(0);
++    *index = UINT_MAX;
++
++    QQmlValueTypeWrapper *that = static_cast<QQmlValueTypeWrapper*>(m);
++
++    if (QQmlValueTypeReference *ref = that->as<QQmlValueTypeReference>()) {
++        if (!ref->readReferenceValue())
++            return;
++    }
++
++    if (that->d()->propertyCache) {
++        const QMetaObject *mo = that->d()->propertyCache->createMetaObject();
++        const int propertyCount = mo->propertyCount();
++        if (it->arrayIndex < static_cast<uint>(propertyCount)) {
++            Scope scope(that->engine());
++            ScopedString propName(scope, that->engine()->newString(QString::fromUtf8(mo->property(it->arrayIndex).name())));
++            name->setM(propName->d());
++            ++it->arrayIndex;
++            *attributes = QV4::Attr_Data;
++            p->value = that->QV4::Object::get(propName);
++            return;
++        }
++    }
++    QV4::Object::advanceIterator(m, it, name, index, p, attributes);
++}
++
+ bool QQmlValueTypeWrapper::isEqual(const QVariant& value)
+ {
+     if (QQmlValueTypeReference *ref = as<QQmlValueTypeReference>())
+diff --git a/src/qml/qml/qqmlvaluetypewrapper_p.h b/src/qml/qml/qqmlvaluetypewrapper_p.h
+index c2861f5..94eeba3 100644
+--- a/src/qml/qml/qqmlvaluetypewrapper_p.h
++++ b/src/qml/qml/qqmlvaluetypewrapper_p.h
+@@ -99,6 +99,7 @@ public:
+     static void put(Managed *m, String *name, const Value &value);
+     static bool isEqualTo(Managed *m, Managed *other);
+     static PropertyAttributes query(const Managed *, String *name);
++    static void advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
+ 
+     static QV4::ReturnedValue method_toString(CallContext *ctx);
+ 
+diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+index 300f5b9..f506d0f 100644
+--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
++++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+@@ -30,6 +30,7 @@
+ #include <QQmlEngine>
+ #include <QQmlComponent>
+ #include <QDebug>
++#include <QJSValueIterator>
+ #include <private/qquickvaluetypes_p.h>
+ #include <private/qqmlglobal_p.h>
+ #include "../../shared/util.h"
+@@ -89,6 +90,7 @@ private slots:
+     void customValueTypeInQml();
+     void gadgetInheritance();
+     void toStringConversion();
++    void enumerableProperties();
+ 
+ private:
+     QQmlEngine engine;
+@@ -1649,6 +1651,25 @@ void tst_qqmlvaluetypes::toStringConversion()
+     QCOMPARE(stringConversion.toString(), StringLessGadget_to_QString(g));
+ }
+ 
++void tst_qqmlvaluetypes::enumerableProperties()
++{
++    QJSEngine engine;
++    DerivedGadget g;
++    QJSValue value = engine.toScriptValue(g);
++    QSet<QString> names;
++    QJSValueIterator it(value);
++    while (it.hasNext()) {
++        it.next();
++        const QString name = it.name();
++        QVERIFY(!names.contains(name));
++        names.insert(name);
++    }
++
++    QCOMPARE(names.count(), 2);
++    QVERIFY(names.contains(QStringLiteral("baseProperty")));
++    QVERIFY(names.contains(QStringLiteral("derivedProperty")));
++}
++
+ 
+ QTEST_MAIN(tst_qqmlvaluetypes)
+ 
+-- 
+2.8.1
+
diff --git a/debian/patches/series b/debian/patches/series
index f230c45..87527e0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,6 +5,7 @@ V4-Always-set-the-tag-when-boxing-a-pointer-in-QV4-V.patch
 Fix-QQmlEngine-crash-on-big-endian-64-bit-architectu.patch
 Flickable-fix-minXExtent-minYExtent-when-content-is-.patch
 QQuickWindow-Fill-out-timestamps-in-QHoverEvents-sen.patch
+Fix-visibility-of-properties-in-value-types.patch
 
 # Debian patches
 check_system_double-conversion.patch

-- 
qtdeclarative packaging



More information about the pkg-kde-commits mailing list