Hello community, here is the log from the commit of package kitemmodels for openSUSE:Factory checked in at 2018-02-16 21:31:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kitemmodels (Old) and /work/SRC/openSUSE:Factory/.kitemmodels.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kitemmodels" Fri Feb 16 21:31:57 2018 rev:50 rq:576541 version:5.43.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kitemmodels/kitemmodels.changes 2018-01-22 16:01:36.681394958 +0100 +++ /work/SRC/openSUSE:Factory/.kitemmodels.new/kitemmodels.changes 2018-02-16 21:31:59.110559206 +0100 @@ -1,0 +2,11 @@ +Mon Feb 12 23:42:09 CET 2018 - lbeltr...@kde.org + +- Update to 5.43.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.43.0.php +- Changes since 5.42.0: + * KRearrangeColumnsProxyModel: fix crash when there's no source model + * KRearrangeColumnsProxyModel: reimplement sibling() so it works as expected + +------------------------------------------------------------------- Old: ---- kitemmodels-5.42.0.tar.xz New: ---- kitemmodels-5.43.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kitemmodels.spec ++++++ --- /var/tmp/diff_new_pack.iTeIBl/_old 2018-02-16 21:31:59.962528441 +0100 +++ /var/tmp/diff_new_pack.iTeIBl/_new 2018-02-16 21:31:59.966528297 +0100 @@ -19,13 +19,13 @@ %bcond_with python %define clang_sonum 3.8 %define lname libKF5ItemModels5 -%define _tar_path 5.42 +%define _tar_path 5.43 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %global _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} Name: kitemmodels -Version: 5.42.0 +Version: 5.43.0 Release: 0 BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} ++++++ kitemmodels-5.42.0.tar.xz -> kitemmodels-5.43.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-5.42.0/CMakeLists.txt new/kitemmodels-5.43.0/CMakeLists.txt --- old/kitemmodels-5.42.0/CMakeLists.txt 2018-01-06 00:41:55.000000000 +0100 +++ new/kitemmodels-5.43.0/CMakeLists.txt 2018-02-05 09:11:20.000000000 +0100 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.42.0") # handled by release scripts +set(KF5_VERSION "5.43.0") # handled by release scripts project(KItemModels VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.42.0 NO_MODULE) +find_package(ECM 5.43.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-5.42.0/autotests/krearrangecolumnsproxymodeltest.cpp new/kitemmodels-5.43.0/autotests/krearrangecolumnsproxymodeltest.cpp --- old/kitemmodels-5.42.0/autotests/krearrangecolumnsproxymodeltest.cpp 2018-01-06 00:41:55.000000000 +0100 +++ new/kitemmodels-5.43.0/autotests/krearrangecolumnsproxymodeltest.cpp 2018-02-05 09:11:20.000000000 +0100 @@ -65,6 +65,16 @@ // showModel(&mod); } + void shouldShowNothingIfNoSourceModel() + { + // Given a rearrange-columns proxy with no source model + KRearrangeColumnsProxyModel pm; + + // Then the proxy should show nothing (no columns selected) + QCOMPARE(pm.rowCount(), 0); + QCOMPARE(pm.columnCount(), 0); + } + void shouldShowNothingIfNoColumnSelection() { // Given a rearrange-columns proxy @@ -121,6 +131,9 @@ QCOMPARE(pm.mapToSource(pm.index(0, 0)).column(), 2); // column 0 points to C QCOMPARE(pm.mapToSource(pm.index(0, 1)).column(), 3); // column 1 points to D + QCOMPARE(pm.sibling(0, 1, pm.index(0, 0)).column(), 1); + QCOMPARE(pm.sibling(0, 0, pm.index(0, 1)).column(), 0); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("CDBA")); QCOMPARE(extractRowTexts(&pm, 0, pm.index(0, 0)), QStringLiteral("opnm")); QCOMPARE(extractRowTexts(&pm, 1, pm.index(0, 0)), QStringLiteral("strq")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-5.42.0/src/krearrangecolumnsproxymodel.cpp new/kitemmodels-5.43.0/src/krearrangecolumnsproxymodel.cpp --- old/kitemmodels-5.42.0/src/krearrangecolumnsproxymodel.cpp 2018-01-06 00:41:55.000000000 +0100 +++ new/kitemmodels-5.43.0/src/krearrangecolumnsproxymodel.cpp 2018-02-05 09:11:20.000000000 +0100 @@ -44,12 +44,18 @@ int KRearrangeColumnsProxyModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); + if (!sourceModel()) { + return 0; + } return d_ptr->m_sourceColumns.count(); } int KRearrangeColumnsProxyModel::rowCount(const QModelIndex &parent) const { Q_ASSERT(parent.isValid() ? parent.model() == this : true); + if (!sourceModel()) { + return 0; + } // The parent in the source model is on column 0, whatever swapping we are doing const QModelIndex sourceParent = mapToSource(parent).sibling(parent.row(), 0); return sourceModel()->rowCount(sourceParent); @@ -97,6 +103,14 @@ } } +QModelIndex KRearrangeColumnsProxyModel::sibling(int row, int column, const QModelIndex &idx) const +{ + if (column >= d_ptr->m_sourceColumns.count()) { + return QModelIndex(); + } + return index(row, column, idx.parent()); +} + QModelIndex KRearrangeColumnsProxyModel::mapFromSource(const QModelIndex &sourceIndex) const { if (!sourceIndex.isValid()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitemmodels-5.42.0/src/krearrangecolumnsproxymodel.h new/kitemmodels-5.43.0/src/krearrangecolumnsproxymodel.h --- old/kitemmodels-5.42.0/src/krearrangecolumnsproxymodel.h 2018-01-06 00:41:55.000000000 +0100 +++ new/kitemmodels-5.43.0/src/krearrangecolumnsproxymodel.h 2018-02-05 09:11:20.000000000 +0100 @@ -87,6 +87,9 @@ /// @reimp QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + /// @reimp + QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE; + private: int proxyColumnForSourceColumn(int sourceColumn) const; int sourceColumnForProxyColumn(int proxyColumn) const;