[SCM] qtdeclarative packaging branch, ubuntu, updated. ubuntu/5.5.1-2ubuntu3-10-g11f0ddc
Timo Jyrinki
timo at moszumanska.debian.org
Fri Feb 5 14:29:12 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtdeclarative.git;a=commitdiff;h=11f0ddc
The following commit has been merged in the ubuntu branch:
commit 11f0ddc6bfc6cb0abaf14cc627c80b4d02a2fc56
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date: Fri Feb 5 14:28:51 2016 +0000
Fix broken qml type description files: (LP: #1541346)
---
debian/changelog | 2 +
.../qml-preserve-composite-singleton-types.patch | 163 +++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 166 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 11302be..8e8bdb7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ qtdeclarative-opensource-src (5.5.1-2ubuntu5) UNRELEASED; urgency=medium
* debian/patches/Don-t-check-for-revisions-when-assigning-to-grouped-.patch:
- Fix versioning (LP: #1389721)
+ * debian/patches/qml-preserve-composite-singleton-types.patch:
+ - Fix broken qml type description files: (LP: #1541346)
-- Timo Jyrinki <timo-jyrinki at ubuntu.com> Mon, 01 Feb 2016 14:39:12 +0000
diff --git a/debian/patches/qml-preserve-composite-singleton-types.patch b/debian/patches/qml-preserve-composite-singleton-types.patch
new file mode 100644
index 0000000..1ecc91e
--- /dev/null
+++ b/debian/patches/qml-preserve-composite-singleton-types.patch
@@ -0,0 +1,163 @@
+From 4b018848f7a7055976895de8a4b8208b58a36fac Mon Sep 17 00:00:00 2001
+From: Marco Benelli <marco.benelli at theqtcompany.com>
+Date: Fri, 4 Dec 2015 15:56:07 +0100
+Subject: [PATCH] qml: preserve composite singleton types.
+
+Composite singleton types used to always have version -1,-1; regardless
+of what is written in qmldir.
+
+Change-Id: Ia193e73695e57095f6a09b97768805f2f23cd56a
+Reviewed-by: Erik Verbruggen <erik.verbruggen at theqtcompany.com>
+---
+ src/qml/qml/qqmlimport.cpp | 19 +++++++++++++------
+ src/qml/qml/qqmlimport_p.h | 2 ++
+ src/qml/qml/qqmltypeloader.cpp | 4 ++--
+ .../tests/dumper/CompositeSingleton/Singleton.qml | 6 ++++++
+ .../tests/dumper/CompositeSingleton/qmldir | 3 +++
+ tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp | 14 ++++++++++++++
+ 6 files changed, 40 insertions(+), 8 deletions(-)
+ create mode 100644 tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml
+ create mode 100644 tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir
+
+diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
+index f6f8c6e..d538199 100644
+--- a/src/qml/qml/qqmlimport.cpp
++++ b/src/qml/qml/qqmlimport.cpp
+@@ -125,7 +125,9 @@ bool isPathAbsolute(const QString &path)
+ }
+
+ // If the type does not already exist as a file import, add the type and return the new type
+-QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeName, bool isCompositeSingleton, QList<QQmlError> *errors)
++QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeName,
++ bool isCompositeSingleton, QList<QQmlError> *errors,
++ int majorVersion=-1, int minorVersion=-1)
+ {
+ QUrl url(urlString);
+ QQmlType *ret = QQmlMetaType::qmlType(url);
+@@ -140,8 +142,8 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa
+ QQmlPrivate::RegisterCompositeSingletonType reg = {
+ url,
+ "", //Empty URI indicates loaded via file imports
+- -1,
+- -1,
++ majorVersion,
++ minorVersion,
+ buf.constData()
+ };
+ ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeSingletonRegistration, ®));
+@@ -149,8 +151,8 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa
+ QQmlPrivate::RegisterCompositeType reg = {
+ url,
+ "", //Empty URI indicates loaded via file imports
+- -1,
+- -1,
++ majorVersion,
++ minorVersion,
+ buf.constData()
+ };
+ ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeRegistration, ®));
+@@ -416,6 +418,8 @@ void findCompositeSingletons(const QQmlImportNamespace &set, QList<QQmlImports::
+ QQmlImports::CompositeSingletonReference ref;
+ ref.typeName = cit->typeName;
+ ref.prefix = set.prefix;
++ ref.majorVersion = cit->majorVersion;
++ ref.minorVersion = cit->minorVersion;
+ resultList.append(ref);
+ }
+ }
+@@ -656,7 +660,10 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
+ }
+
+ if (candidate != end) {
+- QQmlType *returnType = getTypeForUrl(componentUrl, type, isCompositeSingleton, 0);
++ int major = vmajor ? *vmajor : -1;
++ int minor = vminor ? *vminor : -1;
++ QQmlType *returnType = getTypeForUrl(componentUrl, type, isCompositeSingleton, 0,
++ major, minor);
+ if (type_return)
+ *type_return = returnType;
+ return returnType != 0;
+diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h
+index bda87f2..951b975 100644
+--- a/src/qml/qml/qqmlimport_p.h
++++ b/src/qml/qml/qqmlimport_p.h
+@@ -118,6 +118,8 @@ public:
+ {
+ QString typeName;
+ QString prefix;
++ int majorVersion;
++ int minorVersion;
+ };
+
+ QList<CompositeSingletonReference> resolvedCompositeSingletons() const;
+diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
+index 29f1ca7..1e67154 100644
+--- a/src/qml/qml/qqmltypeloader.cpp
++++ b/src/qml/qml/qqmltypeloader.cpp
+@@ -2320,8 +2320,8 @@ void QQmlTypeData::resolveTypes()
+ m_namespaces.insert(csRef.prefix);
+ }
+
+- int majorVersion = -1;
+- int minorVersion = -1;
++ int majorVersion = csRef.majorVersion > -1 ? csRef.majorVersion : -1;
++ int minorVersion = csRef.minorVersion > -1 ? csRef.minorVersion : -1;
+
+ if (!resolveType(typeName, majorVersion, minorVersion, ref))
+ return;
+diff --git a/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml
+new file mode 100644
+index 0000000..b47d2e9
+--- /dev/null
++++ b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml
+@@ -0,0 +1,6 @@
++pragma Singleton
++import QtQuick 2.0
++
++QtObject {
++ property int test: 0
++}
+diff --git a/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir
+new file mode 100644
+index 0000000..8df57f6
+--- /dev/null
++++ b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir
+@@ -0,0 +1,3 @@
++module tests.dumper.CompositeSingleton
++singleton Singleton 1.0 Singleton.qml
++depends QtQuick 2.0
+diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+index 28d687b..eb05e8c 100644
+--- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
++++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+@@ -47,6 +47,7 @@ public:
+ private slots:
+ void initTestCase();
+ void builtins();
++ void singleton();
+
+ private:
+ QString qmlplugindumpPath;
+@@ -102,6 +103,19 @@ void tst_qmlplugindump::builtins()
+ QVERIFY(result.contains(QLatin1String("Module {")));
+ }
+
++void tst_qmlplugindump::singleton()
++{
++ QProcess dumper;
++ QStringList args;
++ args << QLatin1String("tests.dumper.CompositeSingleton") << QLatin1String("1.0")
++ << QLatin1String(".");
++ dumper.start(qmlplugindumpPath, args);
++ dumper.waitForFinished();
++
++ const QString &result = dumper.readAllStandardOutput();
++ QVERIFY(result.contains(QLatin1String("exports: [\"Singleton 1.0\"]")));
++}
++
+ QTEST_MAIN(tst_qmlplugindump)
+
+ #include "tst_qmlplugindump.moc"
+--
+2.7.0
+
diff --git a/debian/patches/series b/debian/patches/series
index ae621bd..03db0d1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,3 +20,4 @@ check_system_double-conversion.patch
fix_binary_location_for_tests.patch
disable_failing_tests.patch
QML-Compilation-unit-caching-and-JIT-changes.patch
+qml-preserve-composite-singleton-types.patch
--
qtdeclarative packaging
More information about the pkg-kde-commits
mailing list