commit kf6-kitemmodels for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kf6-kitemmodels for openSUSE:Factory checked in at 2024-07-14 08:49:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kf6-kitemmodels (Old) and /work/SRC/openSUSE:Factory/.kf6-kitemmodels.new.17339 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kf6-kitemmodels" Sun Jul 14 08:49:57 2024 rev:5 rq:1187123 version:6.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kf6-kitemmodels/kf6-kitemmodels.changes 2024-06-09 20:22:49.067117535 +0200 +++ /work/SRC/openSUSE:Factory/.kf6-kitemmodels.new.17339/kf6-kitemmodels.changes 2024-07-14 08:53:10.994333128 +0200 @@ -1,0 +2,12 @@ +Tue Jul 9 09:41:49 UTC 2024 - Christophe Marin <christophe@krop.fr> + +- Update to 6.4.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/6/6.4.0 +- Changes since 6.3.0: + * kdescendantsproxymodel: fix nested signals on source model reset + * kdescendantsproxymodeltest: use model tester in the tests where it passes + * Port kdescendantsproxymodeltest to std::unique_ptr + +------------------------------------------------------------------- Old: ---- kitemmodels-6.3.0.tar.xz kitemmodels-6.3.0.tar.xz.sig New: ---- kitemmodels-6.4.0.tar.xz kitemmodels-6.4.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kf6-kitemmodels.spec ++++++ --- /var/tmp/diff_new_pack.MK8lYP/_old 2024-07-14 08:53:11.690358559 +0200 +++ /var/tmp/diff_new_pack.MK8lYP/_new 2024-07-14 08:53:11.694358706 +0200 @@ -19,14 +19,14 @@ %define qt6_version 6.6.0 %define rname kitemmodels -# Full KF6 version (e.g. 6.3.0) +# Full KF6 version (e.g. 6.4.0) %{!?_kf6_version: %global _kf6_version %{version}} # Last major and minor KF6 version (e.g. 6.0) %{!?_kf6_bugfix_version: %define _kf6_bugfix_version %(echo %{_kf6_version} | awk -F. '{print $1"."$2}')} %bcond_with python %bcond_without released Name: kf6-kitemmodels -Version: 6.3.0 +Version: 6.4.0 Release: 0 Summary: Set of item models extending the Qt model-view framework License: LGPL-2.1-or-later ++++++ kitemmodels-6.3.0.tar.xz -> kitemmodels-6.4.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-6.3.0/CMakeLists.txt new/kitemmodels-6.4.0/CMakeLists.txt --- old/kitemmodels-6.3.0/CMakeLists.txt 2024-05-31 15:26:29.000000000 +0200 +++ new/kitemmodels-6.4.0/CMakeLists.txt 2024-07-05 22:07:45.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "6.3.0") # handled by release scripts +set(KF_VERSION "6.4.0") # handled by release scripts project(KItemModels VERSION ${KF_VERSION}) include(FeatureSummary) -find_package(ECM 6.3.0 NO_MODULE) +find_package(ECM 6.4.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-6.3.0/autotests/kdescendantsproxymodeltest.cpp new/kitemmodels-6.4.0/autotests/kdescendantsproxymodeltest.cpp --- old/kitemmodels-6.3.0/autotests/kdescendantsproxymodeltest.cpp 2024-05-31 15:26:29.000000000 +0200 +++ new/kitemmodels-6.4.0/autotests/kdescendantsproxymodeltest.cpp 2024-07-05 22:07:45.000000000 +0200 @@ -6,7 +6,9 @@ #include "kdescendantsproxymodel.h" +#include <QAbstractItemModelTester> #include <QAbstractListModel> +#include <QIdentityProxyModel> #include <QSignalSpy> #include <QStandardItemModel> #include <QTest> @@ -247,7 +249,7 @@ class tst_KDescendantProxyModel : public QObject { Q_OBJECT - QAbstractItemModel *createTree(const QString &prefix) + std::unique_ptr<QStandardItemModel> createTree(const QString &prefix) { /* * |- parent1 @@ -257,7 +259,7 @@ * |- child1 * `- child2 */ - QStandardItemModel *model = new QStandardItemModel(this); + auto model = std::make_unique<QStandardItemModel>(this); for (int i = 0; i < 2; i++) { QStandardItem *item = new QStandardItem(); item->setData(QString(prefix + QString::number(i)), Qt::DisplayRole); @@ -273,6 +275,7 @@ private Q_SLOTS: void testResetModelContent(); + void testSourceModelReset(); void testChangeSeparator(); void testChangeInvisibleSeparator(); void testRemoveSeparator(); @@ -291,16 +294,21 @@ { auto model1 = createTree("FirstModel"); KDescendantsProxyModel proxy; - proxy.setSourceModel(model1); + new QAbstractItemModelTester(&proxy); + proxy.setSourceModel(model1.get()); QCOMPARE(proxy.rowCount(), 6); { - QStringList results = QStringList() << "FirstModel0" - << "FirstModel0-0" - << "FirstModel0-1" - << "FirstModel1" - << "FirstModel1-0" - << "FirstModel1-1"; + // clang-format off + const QStringList results { + "FirstModel0", + "FirstModel0-0", + "FirstModel0-1", + "FirstModel1", + "FirstModel1-0", + "FirstModel1-1" + }; + // clang-format on QCOMPARE(proxy.rowCount(), results.count()); for (int i = 0; i < proxy.rowCount(); i++) { QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); @@ -308,21 +316,70 @@ } auto model2 = createTree("SecondModel"); { - proxy.setSourceModel(model2); - QStringList results = QStringList() << "SecondModel0" - << "SecondModel0-0" - << "SecondModel0-1" - << "SecondModel1" - << "SecondModel1-0" - << "SecondModel1-1"; + proxy.setSourceModel(model2.get()); + // clang-format off + const QStringList results { + "SecondModel0", + "SecondModel0-0", + "SecondModel0-1", + "SecondModel1", + "SecondModel1-0", + "SecondModel1-1" + }; + // clang-format on QCOMPARE(proxy.rowCount(), results.count()); for (int i = 0; i < proxy.rowCount(); i++) { QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); } } +} + +/// Tests that a reset in the source model results in data getting changed +void tst_KDescendantProxyModel::testSourceModelReset() +{ + auto model1 = createTree("FirstModel"); + KDescendantsProxyModel proxy; + new QAbstractItemModelTester(&proxy); // ensure no nested signals + QIdentityProxyModel identityProxy; + identityProxy.setSourceModel(model1.get()); + proxy.setSourceModel(&identityProxy); + QCOMPARE(proxy.rowCount(), 6); - delete model2; - delete model1; + { + // clang-format off + const QStringList results { + "FirstModel0", + "FirstModel0-0", + "FirstModel0-1", + "FirstModel1", + "FirstModel1-0", + "FirstModel1-1" + }; + // clang-format on + QCOMPARE(proxy.rowCount(), results.count()); + for (int i = 0; i < proxy.rowCount(); i++) { + QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); + } + } + + auto model2 = createTree("SecondModel"); + { + identityProxy.setSourceModel(model2.get()); // This makes QIdentityProxyModel emit a reset + // clang-format off + const QStringList results { + "SecondModel0", + "SecondModel0-0", + "SecondModel0-1", + "SecondModel1", + "SecondModel1-0", + "SecondModel1-1" + }; + // clang-format on + QCOMPARE(proxy.rowCount(), results.count()); + for (int i = 0; i < proxy.rowCount(); i++) { + QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); + } + } } /// tests that change separator works, as well as emits the relevant data changed signals @@ -330,7 +387,8 @@ { auto model1 = createTree("FirstModel"); KDescendantsProxyModel proxy; - proxy.setSourceModel(model1); + new QAbstractItemModelTester(&proxy); + proxy.setSourceModel(model1.get()); proxy.setDisplayAncestorData(true); QSignalSpy dataChangedSpy(&proxy, &QAbstractItemModel::dataChanged); QCOMPARE(proxy.rowCount(), 6); @@ -360,8 +418,6 @@ QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); } } - - delete model1; } /// tests that change separator that is not shown does not change the content and does not @@ -370,7 +426,8 @@ { auto model1 = createTree("FirstModel"); KDescendantsProxyModel proxy; - proxy.setSourceModel(model1); + new QAbstractItemModelTester(&proxy); + proxy.setSourceModel(model1.get()); QSignalSpy dataChangedSpy(&proxy, &QAbstractItemModel::dataChanged); QCOMPARE(proxy.rowCount(), 6); { @@ -399,8 +456,6 @@ QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); } } - - delete model1; } /// tests that data is properly updated when separator is removed/hidden @@ -409,7 +464,8 @@ { auto model1 = createTree("FirstModel"); KDescendantsProxyModel proxy; - proxy.setSourceModel(model1); + new QAbstractItemModelTester(&proxy); + proxy.setSourceModel(model1.get()); QSignalSpy dataChangedSpy(&proxy, &QAbstractItemModel::dataChanged); proxy.setDisplayAncestorData(true); QCOMPARE(dataChangedSpy.count(), 1); @@ -447,8 +503,9 @@ { auto model1 = createTree("FirstModel"); KDescendantsProxyModel proxy; + new QAbstractItemModelTester(&proxy); proxy.setExpandsByDefault(false); - proxy.setSourceModel(model1); + proxy.setSourceModel(model1.get()); QCOMPARE(proxy.rowCount(), 2); { @@ -488,7 +545,7 @@ auto model2 = createTree("SecondModel"); { - proxy.setSourceModel(model2); + proxy.setSourceModel(model2.get()); QModelIndex idx = model2->index(0, 0); proxy.expandSourceIndex(idx); idx = model2->index(1, 0); @@ -504,17 +561,14 @@ QCOMPARE(proxy.index(i, 0).data(Qt::DisplayRole).toString(), results[i]); } } - - delete model2; - delete model1; } void tst_KDescendantProxyModel::testInsertInCollapsedModel() { - QStandardItemModel *model1 = static_cast<QStandardItemModel *>(createTree("Model")); + auto model1 = createTree("Model"); KDescendantsProxyModel proxy; proxy.setExpandsByDefault(false); - proxy.setSourceModel(model1); + proxy.setSourceModel(model1.get()); QCOMPARE(proxy.rowCount(), 2); QSignalSpy insertSpy(&proxy, &QAbstractItemModel::rowsInserted); @@ -551,10 +605,10 @@ void tst_KDescendantProxyModel::testRemoveInCollapsedModel() { - QStandardItemModel *model1 = static_cast<QStandardItemModel *>(createTree("Model")); + auto model1 = createTree("Model"); KDescendantsProxyModel proxy; proxy.setExpandsByDefault(false); - proxy.setSourceModel(model1); + proxy.setSourceModel(model1.get()); QCOMPARE(proxy.rowCount(), 2); QSignalSpy removeSpy(&proxy, &QAbstractItemModel::rowsRemoved); @@ -678,6 +732,7 @@ model->insert(QModelIndex(), 0, QStringLiteral("Row0")); model->insert(QModelIndex(), 0, QStringLiteral("Row1")); KDescendantsProxyModel proxy; + new QAbstractItemModelTester(&proxy); proxy.setSourceModel(model); QCOMPARE(proxy.rowCount(), 0); } @@ -695,6 +750,7 @@ model->getRootNode()->knownChildren = 2; KDescendantsProxyModel proxy; + new QAbstractItemModelTester(&proxy); proxy.setSourceModel(model); proxy.setExpandsByDefault(false); QCOMPARE(proxy.rowCount(), 2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-6.3.0/src/core/kdescendantsproxymodel.cpp new/kitemmodels-6.4.0/src/core/kdescendantsproxymodel.cpp --- old/kitemmodels-6.3.0/src/core/kdescendantsproxymodel.cpp 2024-05-31 15:26:29.000000000 +0200 +++ new/kitemmodels-6.4.0/src/core/kdescendantsproxymodel.cpp 2024-07-05 22:07:45.000000000 +0200 @@ -1202,6 +1202,7 @@ { Q_Q(KDescendantsProxyModel); q->beginResetModel(); + m_relayouting = true; } void KDescendantsProxyModelPrivate::sourceModelReset() @@ -1212,6 +1213,7 @@ m_pendingParents.append(QModelIndex()); scheduleProcessPendingParents(); } + m_relayouting = false; q->endResetModel(); }
participants (1)
-
Source-Sync