commit kirigami2 for openSUSE:Factory
Hello community, here is the log from the commit of package kirigami2 for openSUSE:Factory checked in at 2019-12-02 11:27:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kirigami2 (Old) and /work/SRC/openSUSE:Factory/.kirigami2.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kirigami2" Mon Dec 2 11:27:34 2019 rev:34 rq:749979 version:5.64.1 Changes: -------- --- /work/SRC/openSUSE:Factory/kirigami2/kirigami2.changes 2019-11-12 11:48:08.834894161 +0100 +++ /work/SRC/openSUSE:Factory/.kirigami2.new.4691/kirigami2.changes 2019-12-02 11:29:09.218620869 +0100 @@ -1,0 +2,8 @@ +Wed Nov 20 18:17:03 UTC 2019 - Wolfgang Bauer <wbauer@tmo.at> + +- Update to 5.64.1 + * New bugfix release +- Changes since 5.64.0: + * Make QmlComponentsPool one instance per engine (kde#414003) + +------------------------------------------------------------------- Old: ---- kirigami2-5.64.0.tar.xz kirigami2-5.64.0.tar.xz.sig New: ---- kirigami2-5.64.1.tar.xz kirigami2-5.64.1.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kirigami2.spec ++++++ --- /var/tmp/diff_new_pack.Sv6aAj/_old 2019-12-02 11:29:10.634620213 +0100 +++ /var/tmp/diff_new_pack.Sv6aAj/_new 2019-12-02 11:29:10.666620198 +0100 @@ -24,7 +24,7 @@ %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: kirigami2 -Version: 5.64.0 +Version: 5.64.1 Release: 0 Summary: Set of QtQuick components License: LGPL-2.1-or-later ++++++ kirigami2-5.64.0.tar.xz -> kirigami2-5.64.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kirigami2-5.64.0/src/columnview.cpp new/kirigami2-5.64.1/src/columnview.cpp --- old/kirigami2-5.64.0/src/columnview.cpp 2019-11-07 03:58:43.000000000 +0100 +++ new/kirigami2-5.64.1/src/columnview.cpp 2019-11-20 16:28:32.000000000 +0100 @@ -38,23 +38,37 @@ public: QmlComponentsPoolSingleton() {} - - QmlComponentsPool self; + static QmlComponentsPool *instance(QQmlEngine *engine); +private: + QHash<QQmlEngine*, QmlComponentsPool*> m_instances; }; Q_GLOBAL_STATIC(QmlComponentsPoolSingleton, privateQmlComponentsPoolSelf) -QmlComponentsPool::QmlComponentsPool(QObject *parent) - : QObject(parent) -{} - -void QmlComponentsPool::initialize(QQmlEngine *engine) +QmlComponentsPool *QmlComponentsPoolSingleton::instance(QQmlEngine *engine) { - if (!engine || m_instance) { - return; + Q_ASSERT(engine); + auto componentPool = privateQmlComponentsPoolSelf->m_instances.value(engine); + + if (componentPool) { + return componentPool; } + componentPool = new QmlComponentsPool(engine); + + QObject::connect(componentPool, &QObject::destroyed, [engine]() { + if (privateQmlComponentsPoolSelf) { + privateQmlComponentsPoolSelf->m_instances.remove(engine); + } + }); + privateQmlComponentsPoolSelf->m_instances[engine] = componentPool; + return componentPool; +} + +QmlComponentsPool::QmlComponentsPool(QQmlEngine *engine) + : QObject(engine) +{ QQmlComponent *component = new QQmlComponent(engine, this); component->setData(QByteArrayLiteral("import QtQuick 2.7\n" @@ -575,12 +589,12 @@ QQuickItem *separatorItem = m_separators.value(item); if (!separatorItem) { - separatorItem = qobject_cast<QQuickItem *>(privateQmlComponentsPoolSelf->self.m_separatorComponent->beginCreate(QQmlEngine::contextForObject(item))); + separatorItem = qobject_cast<QQuickItem *>(privateQmlComponentsPoolSelf->instance(qmlEngine(item))->m_separatorComponent->beginCreate(QQmlEngine::contextForObject(item))); if (separatorItem) { separatorItem->setParentItem(item); separatorItem->setZ(9999); separatorItem->setProperty("column", QVariant::fromValue(item)); - privateQmlComponentsPoolSelf->self.m_separatorComponent->completeCreate(); + QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_separatorComponent->completeCreate(); m_separators[item] = separatorItem; } } @@ -593,12 +607,12 @@ QQuickItem *separatorItem = m_rightSeparators.value(item); if (!separatorItem) { - separatorItem = qobject_cast<QQuickItem *>(privateQmlComponentsPoolSelf->self.m_rightSeparatorComponent->beginCreate(QQmlEngine::contextForObject(item))); + separatorItem = qobject_cast<QQuickItem *>(QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_rightSeparatorComponent->beginCreate(QQmlEngine::contextForObject(item))); if (separatorItem) { separatorItem->setParentItem(item); separatorItem->setZ(9999); separatorItem->setProperty("column", QVariant::fromValue(item)); - privateQmlComponentsPoolSelf->self.m_rightSeparatorComponent->completeCreate(); + QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_rightSeparatorComponent->completeCreate(); m_rightSeparators[item] = separatorItem; } } @@ -772,7 +786,7 @@ void ColumnView::setColumnWidth(qreal width) { // Always forget the internal binding when the user sets anything, even the same value - disconnect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::gridUnitChanged, this, nullptr); + disconnect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::gridUnitChanged, this, nullptr); if (m_contentItem->m_columnWidth == width) { return; @@ -915,7 +929,7 @@ void ColumnView::setScrollDuration(int duration) { - disconnect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::longDurationChanged, this, nullptr); + disconnect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::longDurationChanged, this, nullptr); if (m_contentItem->m_slideAnim->duration() == duration) { return; @@ -1416,22 +1430,20 @@ void ColumnView::classBegin() { - privateQmlComponentsPoolSelf->self.initialize(qmlEngine(this)); - auto syncColumnWidth = [this]() { - m_contentItem->m_columnWidth = privateQmlComponentsPoolSelf->self.m_units->property("gridUnit").toInt() * 20; + m_contentItem->m_columnWidth = privateQmlComponentsPoolSelf->instance(qmlEngine(this))->m_units->property("gridUnit").toInt() * 20; emit columnWidthChanged(); }; - connect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::gridUnitChanged, this, syncColumnWidth); + connect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::gridUnitChanged, this, syncColumnWidth); syncColumnWidth(); auto syncDuration = [this]() { - m_contentItem->m_slideAnim->setDuration(privateQmlComponentsPoolSelf->self.m_units->property("longDuration").toInt()); + m_contentItem->m_slideAnim->setDuration(QmlComponentsPoolSingleton::instance(qmlEngine(this))->m_units->property("longDuration").toInt()); emit scrollDurationChanged(); }; - connect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::longDurationChanged, this, syncDuration); + connect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::longDurationChanged, this, syncDuration); syncDuration(); QQuickItem::classBegin(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kirigami2-5.64.0/src/columnview_p.h new/kirigami2-5.64.1/src/columnview_p.h --- old/kirigami2-5.64.0/src/columnview_p.h 2019-11-07 03:58:43.000000000 +0100 +++ new/kirigami2-5.64.1/src/columnview_p.h 2019-11-20 16:28:32.000000000 +0100 @@ -32,11 +32,9 @@ Q_OBJECT public: - QmlComponentsPool(QObject *parent = nullptr); + QmlComponentsPool(QQmlEngine *engine); ~QmlComponentsPool(); - void initialize(QQmlEngine *engine); - QQmlComponent *m_separatorComponent = nullptr; QQmlComponent *m_rightSeparatorComponent = nullptr; QObject *m_units = nullptr;
participants (1)
-
root