Hello community,

here is the log from the commit of package kitemmodels for openSUSE:Factory 
checked in at 2014-05-14 20:26:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kitemmodels (Old)
 and      /work/SRC/openSUSE:Factory/.kitemmodels.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kitemmodels"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kitemmodels/kitemmodels.changes  2014-04-02 
17:22:22.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kitemmodels.new/kitemmodels.changes     
2014-05-14 20:27:29.000000000 +0200
@@ -1,0 +2,9 @@
+Sun May  4 01:41:15 UTC 2014 - [email protected]
+
+- Update to 4.99.0
+  * API improvements and cleanups
+  * Buildsystem fixes
+  * For more details please see:
+    http://www.kde.org/announcements/announce-frameworks5-beta2.php
+
+-------------------------------------------------------------------

Old:
----
  kitemmodels-4.98.0.tar.xz

New:
----
  kitemmodels-4.99.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kitemmodels.spec ++++++
--- /var/tmp/diff_new_pack.6oDwLu/_old  2014-05-14 20:27:30.000000000 +0200
+++ /var/tmp/diff_new_pack.6oDwLu/_new  2014-05-14 20:27:30.000000000 +0200
@@ -18,10 +18,10 @@
 
 %define lname   libKF5ItemModels5
 Name:           kitemmodels
-Version:        4.98.0
+Version:        4.99.0
 Release:        0
 BuildRequires:  cmake >= 2.8.12
-BuildRequires:  extra-cmake-modules >= 0.0.12
+BuildRequires:  extra-cmake-modules >= 0.0.13
 BuildRequires:  fdupes
 BuildRequires:  kf5-filesystem
 BuildRequires:  pkgconfig(Qt5Core) >= 5.2.0

++++++ kitemmodels-4.98.0.tar.xz -> kitemmodels-4.99.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-4.98.0/CMakeLists.txt 
new/kitemmodels-4.99.0/CMakeLists.txt
--- old/kitemmodels-4.98.0/CMakeLists.txt       2014-03-28 19:35:13.000000000 
+0100
+++ new/kitemmodels-4.99.0/CMakeLists.txt       2014-05-04 20:59:51.000000000 
+0200
@@ -2,7 +2,7 @@
 
 project(KItemModels)
 
-find_package(ECM 0.0.12 REQUIRED NO_MODULE)
+find_package(ECM 0.0.13 REQUIRED NO_MODULE)
 
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
@@ -19,7 +19,7 @@
 include(ECMSetupVersion)
 include(ECMGenerateHeaders)
 
-set(KF5_VERSION "4.98.0")
+set(KF5_VERSION "4.99.0") # handled by release scripts
 
 ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KITEMMODELS
                         VERSION_HEADER 
"${CMAKE_CURRENT_BINARY_DIR}/kitemmodels_version.h"
@@ -55,9 +55,7 @@
 
 install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kitemmodels_version.h
-  DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
+  DESTINATION ${KF5_INCLUDE_INSTALL_DIR} COMPONENT Devel
 )
 
-if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-  feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
-endif()
+feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-4.98.0/autotests/CMakeLists.txt 
new/kitemmodels-4.99.0/autotests/CMakeLists.txt
--- old/kitemmodels-4.98.0/autotests/CMakeLists.txt     2014-03-28 
19:35:13.000000000 +0100
+++ new/kitemmodels-4.99.0/autotests/CMakeLists.txt     2014-05-04 
20:59:51.000000000 +0200
@@ -27,11 +27,7 @@
 kitemmodels_proxymodel_tests(
   kdescendantsproxymodeltest
   klinkitemselectionmodeltest
-  # TODO fix this test - or the code that it tests!
-  # FAIL!  : SelectionProxyModelTest::testMoveFromRoot(move01) 
'signalList.isEmpty()' returned FALSE. ()
-  #  Loc: 
[/srv/jenkins/workspace/kitemmodels_master_qt5/autotests/proxymodeltestsuite/proxymodeltest.cpp(569)]
-  #  QFATAL : SelectionProxyModelTest::testMoveFromRoot(move02) ASSERT: 
"m_unchangedIndexes.isEmpty()" in file proxymodeltestsuite/modelspy.cpp, line 
253
-  #kselectionproxymodeltest
+  kselectionproxymodeltest
   testmodelqueuedconnections
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-4.98.0/autotests/proxymodeltestsuite/modeltest.cpp 
new/kitemmodels-4.99.0/autotests/proxymodeltestsuite/modeltest.cpp
--- old/kitemmodels-4.98.0/autotests/proxymodeltestsuite/modeltest.cpp  
2014-03-28 19:35:13.000000000 +0100
+++ new/kitemmodels-4.99.0/autotests/proxymodeltestsuite/modeltest.cpp  
2014-05-04 20:59:51.000000000 +0200
@@ -1,6 +1,7 @@
 /****************************************************************************
 **
 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2010 Stephen Kelly <[email protected]>
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the test suite of the Qt Toolkit.
@@ -23,7 +24,30 @@
 /*!
     Connect to all of the models signals.  Whenever anything happens recheck 
everything.
 */
-ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject 
( parent ), model ( _model ), fetchingMore ( false )
+ModelTest::ModelTest ( QAbstractItemModel *_model, Mode testType, QObject 
*parent )
+  : QObject ( parent ),
+    model ( _model ),
+    fetchingMore ( false ),
+    pedantic(testType == Pedantic)
+{
+    init();
+    if (pedantic) {
+        refreshStatus();
+        // This is almost certainly not needed.
+//         connect(QAbstractEventDispatcher::instance(), SIGNAL(awake()), 
SLOT(ensureSteady()));
+    }
+}
+
+ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent )
+  : QObject ( parent ),
+    model ( _model ),
+    fetchingMore ( false ),
+    pedantic( false )
+{
+    init();
+}
+
+void ModelTest::init()
 {
     if (!model)
         qFatal("%s: model must not be null", Q_FUNC_INFO);
@@ -43,6 +67,8 @@
     connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()) 
);
     connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()) );
     connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()) );
+    connect(model, SIGNAL(modelAboutToBeReset()), this, 
SLOT(modelAboutToBeReset()));
+    connect(model, SIGNAL(modelReset()), this, SLOT(modelReset()));
     connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
             this, SLOT(runAllTests()) );
     connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
@@ -66,6 +92,10 @@
             this, SLOT(rowsInserted(QModelIndex,int,int)) );
     connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
             this, SLOT(rowsRemoved(QModelIndex,int,int)) );
+    connect(model, 
SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+            this, 
SLOT(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+    connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+            this, SLOT(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
     connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
             this, SLOT(dataChanged(QModelIndex,QModelIndex)) );
     connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
@@ -134,8 +164,7 @@
     QModelIndex topIndex = model->index ( 0, 0, QModelIndex() );
     int rows = model->rowCount ( topIndex );
     QVERIFY( rows >= 0 );
-    if ( rows > 0 )
-        QVERIFY( model->hasChildren ( topIndex ) );
+    QCOMPARE( model->hasChildren ( topIndex ), rows > 0 );
 
     QModelIndex secondLevelIndex = model->index ( 0, 0, topIndex );
     if ( secondLevelIndex.isValid() ) { // not the top level
@@ -186,8 +215,7 @@
     QVERIFY( !model->hasIndex ( rows, columns ) );
     QVERIFY( !model->hasIndex ( rows + 1, columns + 1 ) );
 
-    if ( rows > 0 )
-        QVERIFY( model->hasIndex ( 0, 0 ) );
+    QCOMPARE( model->hasIndex ( 0, 0 ), rows > 0 );
 
     // hasIndex() is tested more extensively in checkChildren(),
     // but this catches the big mistakes
@@ -250,6 +278,9 @@
     // that is the first level index.
     if ( model->rowCount ( topIndex ) > 0 ) {
         QModelIndex childIndex = model->index ( 0, 0, topIndex );
+        if ( model->parent( childIndex ) != topIndex ) {
+            qDebug() << model->parent( childIndex ) << topIndex << 
topIndex.data();
+        }
         QVERIFY( model->parent ( childIndex ) == topIndex );
     }
 
@@ -299,28 +330,26 @@
     int rows = model->rowCount ( parent );
     int columns = model->columnCount ( parent );
 
-    if ( rows > 0 )
-        QVERIFY( model->hasChildren ( parent ) );
-
     // Some further testing against rows(), columns(), and hasChildren()
     QVERIFY( rows >= 0 );
     QVERIFY( columns >= 0 );
-    if ( rows > 0 )
-        QVERIFY( model->hasChildren ( parent ) );
+    QCOMPARE( model->hasChildren ( parent ), rows > 0 );
 
-    //qDebug() << "parent:" << model->data(parent).toString() << "rows:" << 
rows
-    //         << "columns:" << columns << "parent column:" << parent.column();
+    qDebug() << "parent:" << model->data(parent).toString() << "rows:" << rows
+             << "columns:" << columns << "parent column:" << parent.column();
 
     const QModelIndex topLeftChild = model->index( 0, 0, parent );
 
-    QVERIFY( !model->hasIndex ( rows + 1, 0, parent ) );
+    QVERIFY( !model->hasIndex ( rows, 0, parent ) );
+    QVERIFY( !model->index ( rows, 0, parent ).isValid() );
     for ( int r = 0; r < rows; ++r ) {
         if ( model->canFetchMore ( parent ) ) {
             fetchingMore = true;
             model->fetchMore ( parent );
             fetchingMore = false;
         }
-        QVERIFY( !model->hasIndex ( r, columns + 1, parent ) );
+        QVERIFY( !model->hasIndex ( r, columns, parent ) );
+        QVERIFY( !model->index ( r, columns, parent ).isValid() );
         for ( int c = 0; c < columns; ++c ) {
             QVERIFY( model->hasIndex ( r, c, parent ) );
             QModelIndex index = model->index ( r, c, parent );
@@ -351,10 +380,14 @@
             QCOMPARE( index.column(), c );
             // While you can technically return a QVariant usually this is a 
sign
             // of a bug in data().  Disable if this really is ok in your model.
-//            QVERIFY( model->data ( index, Qt::DisplayRole ).isValid() );
+            if ( !model->data( index, Qt::DisplayRole ).isValid() ) {
+                qDebug() << index << index.data() << index.parent();
+            }
+            QVERIFY( model->data ( index, Qt::DisplayRole ).isValid() );
 
             // If the next test fails here is some somewhat useful debug you 
play with.
 
+            /*
             if (model->parent(index) != parent) {
                 qDebug() << r << c << currentDepth << 
model->data(index).toString()
                          << model->data(parent).toString();
@@ -363,7 +396,7 @@
 //                 QTreeView view;
 //                 view.setModel(model);
 //                 view.show();
-            }
+            }*/
 
             // Check that we can get back our real parent.
             QCOMPARE( model->parent ( index ), parent );
@@ -457,11 +490,11 @@
 
     \sa rowsInserted()
  */
-void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, 
int /* end */)
+void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, 
int end )
 {
 //     Q_UNUSED(end);
-//    qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << 
end << "parent=" << model->data ( parent ).toString()
-//    << "current count of parent=" << model->rowCount ( parent ); // << 
"display of last=" << model->data( model->index(start-1, 0, parent) );
+    qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end 
<< "parent=" << model->data ( parent ).toString()
+             << "current count of parent=" << model->rowCount ( parent ); // 
<< "display of last=" << model->data( model->index(start-1, 0, parent) );
 //     qDebug() << model->index(start-1, 0, parent) << model->data( 
model->index(start-1, 0, parent) );
     Changing c;
     c.parent = parent;
@@ -469,6 +502,10 @@
     c.last = model->data ( model->index ( start - 1, 0, parent ) );
     c.next = model->data ( model->index ( start, 0, parent ) );
     insert.push ( c );
+    if (pedantic) {
+      ensureConsistent();
+      status.type = Status::InsertingRows;
+    }
 }
 
 /*!
@@ -480,41 +517,136 @@
 {
     Changing c = insert.pop();
     QVERIFY( c.parent == parent );
-//    qDebug() << "rowsInserted"  << "start=" << start << "end=" << end << 
"oldsize=" << c.oldSize
-//    << "parent=" << model->data ( parent ).toString() << "current rowcount 
of parent=" << model->rowCount ( parent );
+    qDebug() << "rowsInserted"  << "start=" << start << "end=" << end << 
"oldsize=" << c.oldSize
+             << "parent=" << model->data ( parent ).toString() << "current 
rowcount of parent=" << model->rowCount ( parent );
 
-//    for (int ii=start; ii <= end; ii++)
-//    {
-//      qDebug() << "itemWasInserted:" << ii << model->data ( model->index ( 
ii, 0, parent ));
-//    }
-//    qDebug();
+    for (int ii=start; ii <= end; ii++)
+    {
+      qDebug() << "itemWasInserted:" << ii << model->data ( model->index ( ii, 
0, parent ));
+    }
 
     QVERIFY( c.oldSize + ( end - start + 1 ) == model->rowCount ( parent ) );
     QVERIFY( c.last == model->data ( model->index ( start - 1, 0, c.parent ) ) 
);
 
+    /*
     if (c.next != model->data(model->index(end + 1, 0, c.parent))) {
         qDebug() << start << end;
         for (int i=0; i < model->rowCount(); ++i)
             qDebug() << model->index(i, 0).data().toString();
         qDebug() << c.next << model->data(model->index(end + 1, 0, c.parent));
     }
+    */
 
     QVERIFY( c.next == model->data ( model->index ( end + 1, 0, c.parent ) ) );
+
+    if (pedantic) {
+        QVERIFY(status.type == Status::InsertingRows);
+        refreshStatus();
+    }
+}
+
+void ModelTest::modelAboutToBeReset()
+{
+    qDebug() << "@@@@@@@@@@@" << "modelAboutToBeReset";
+
+    if (pedantic) {
+        ensureConsistent();
+        status.type = Status::Resetting;
+    }
+}
+
+void ModelTest::modelReset()
+{
+    qDebug() << "@@@@@@@@@@@" << "modelReset";
+    if (pedantic) {
+        Q_ASSERT(status.type == Status::Resetting);
+        refreshStatus();
+    }
 }
 
 void ModelTest::layoutAboutToBeChanged()
 {
-    for ( int i = 0; i < qBound ( 0, model->rowCount(), 100 ); ++i )
+    qDebug() << "@@@@@@@@@@@" << "layoutAboutToBeChanged";
+
+    if (pedantic) {
+        ensureConsistent();
+        status.type = Status::ChangingLayout;
+    }
+    for ( int i = 0; i < qBound ( 0, model->rowCount(), 100 ); ++i ) {
         changing.append ( QPersistentModelIndex ( model->index ( i, 0 ) ) );
+    }
 }
 
 void ModelTest::layoutChanged()
 {
+    qDebug() << "@@@@@@@@@@@" << "layoutAboutToBeChanged";
     for ( int i = 0; i < changing.count(); ++i ) {
         QPersistentModelIndex p = changing[i];
         QVERIFY( p == model->index ( p.row(), p.column(), p.parent() ) );
     }
     changing.clear();
+
+    if (pedantic) {
+        QVERIFY(status.type == Status::ChangingLayout);
+        refreshStatus();
+    }
+}
+
+void ModelTest::rowsAboutToBeMoved(const QModelIndex &srcParent, int start, 
int end, const QModelIndex &destParent, int destinationRow)
+{
+    qDebug() << "rowsAboutToBeMoved" << srcParent << start << end << 
destParent << destinationRow;
+
+    for (int row = start, dr = destinationRow; row <= end; ++row, ++dr) {
+        qDebug() << "row" << model->index(row, 0, srcParent).data() << "in " 
<< srcParent << "will be moved to " << destParent << dr;
+    }
+
+    Changing cs;
+    cs.parent = srcParent;
+    cs.oldSize = model->rowCount(srcParent);
+    cs.last = model->data(model->index(start - 1, 0, srcParent));
+    cs.next = model->data(model->index(end + 1, 0, srcParent));
+    remove.push(cs);
+    Changing cd;
+    cd.parent = destParent;
+    cd.oldSize = model->rowCount(destParent);
+    cd.last = model->data(model->index(destinationRow - 1, 0, destParent));
+    cd.next = model->data(model->index(destinationRow, 0, destParent));
+    insert.push(cd);
+}
+
+void ModelTest::rowsMoved(const QModelIndex &srcParent, int start, int end, 
const QModelIndex &destParent, int destinationRow)
+{
+    qDebug() << "rowsMoved" << srcParent << start << end << destParent << 
destinationRow;
+
+    Changing cd = insert.pop();
+    QVERIFY(cd.parent == destParent);
+    if (srcParent == destParent) {
+        QVERIFY(cd.oldSize == model->rowCount(destParent));
+
+        // TODO: Find out what I can assert here about last and next.
+//     QVERIFY ( cd.last == model->data ( model->index ( destinationRow - 1, 
0, cd.parent ) ) );
+//     QVERIFY ( cd.next == model->data ( model->index ( destinationRow + (end 
- start + 1), 0, cd.parent ) ) );
+
+    } else {
+        qDebug() << cd.oldSize << end << start << model->rowCount(destParent) 
<< destParent.data() << "#########";
+        QVERIFY(cd.oldSize + (end - start + 1) == model->rowCount(destParent));
+
+        QVERIFY(cd.last == model->data(model->index(destinationRow - 1, 0, 
cd.parent)));
+        QVERIFY(cd.next == model->data(model->index(destinationRow + (end - 
start + 1), 0, cd.parent)));
+    }
+    Changing cs = remove.pop();
+
+    QVERIFY(cs.parent == srcParent);
+    if (srcParent == destParent) {
+        QVERIFY(cs.oldSize == model->rowCount(srcParent));
+    } else {
+        QVERIFY(cs.oldSize - (end - start + 1) == model->rowCount(srcParent));
+
+        QVERIFY(cs.last == model->data(model->index(start - 1, 0, srcParent)));
+//     qDebug() << cs.next << model->data ( model->index ( start, 0, srcParent 
) );
+        QVERIFY(cs.next == model->data(model->index(start, 0, srcParent)));
+    }
+
 }
 
 /*!
@@ -524,7 +656,16 @@
  */
 void ModelTest::rowsAboutToBeRemoved ( const QModelIndex &parent, int start, 
int end )
 {
-qDebug() << "ratbr" << parent << start << end;
+    qDebug() << "ratbr" << parent << start << end;
+    for (int ii = start; ii <= end; ii++) {
+        qDebug() << "itemwillbe removed:" << model->data(model->index(ii, 0, 
parent));
+    }
+
+    if (pedantic) {
+        ensureConsistent();
+        status.type = Status::RemovingRows;
+    }
+
     Changing c;
     c.parent = parent;
     c.oldSize = model->rowCount ( parent );
@@ -543,9 +684,56 @@
   qDebug() << "rr" << parent << start << end;
     Changing c = remove.pop();
     QVERIFY( c.parent == parent );
+    qDebug() << (c.oldSize - (end - start + 1)) << model->rowCount(parent);
     QVERIFY( c.oldSize - ( end - start + 1 ) == model->rowCount ( parent ) );
     QVERIFY( c.last == model->data ( model->index ( start - 1, 0, c.parent ) ) 
);
     QVERIFY( c.next == model->data ( model->index ( start, 0, c.parent ) ) );
+
+    if (pedantic) {
+        Q_ASSERT(status.type == Status::RemovingRows);
+        refreshStatus();
+    }
+}
+
+void ModelTest::refreshStatus()
+{
+    status.type = Status::Idle;
+    status.nonPersistent.clear();
+    status.persistent.clear();
+
+    persistStatus(QModelIndex());
+}
+
+void ModelTest::persistStatus(const QModelIndex& index)
+{
+    const int rowCount = model->rowCount(index);
+    for (int row = 0; row < rowCount; ++row)
+    {
+        // TODO: Test multi columns
+        static const int column = 0;
+        QPersistentModelIndex idx = model->index(row, column, index);
+        status.persistent.append(idx);
+        status.nonPersistent.append(idx);
+        persistStatus(idx);
+    }
+}
+
+void ModelTest::ensureSteady()
+{
+    Q_ASSERT(insert.isEmpty());
+    Q_ASSERT(remove.isEmpty());
+    Q_ASSERT(changing.isEmpty());
+    ensureConsistent();
+}
+
+void ModelTest::ensureConsistent()
+{
+    Q_ASSERT(status.type == Status::Idle);
+
+    Q_ASSERT(status.nonPersistent.size() == status.persistent.size());
+    for (int i = 0; i < status.nonPersistent.size(); ++i) {
+        Q_ASSERT(status.nonPersistent.at(i) == status.persistent.at(i));
+    }
 }
 
 void ModelTest::dataChanged(const QModelIndex &topLeft, const QModelIndex 
&bottomRight)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-4.98.0/autotests/proxymodeltestsuite/modeltest.h 
new/kitemmodels-4.99.0/autotests/proxymodeltestsuite/modeltest.h
--- old/kitemmodels-4.98.0/autotests/proxymodeltestsuite/modeltest.h    
2014-03-28 19:35:13.000000000 +0100
+++ new/kitemmodels-4.99.0/autotests/proxymodeltestsuite/modeltest.h    
2014-05-04 20:59:51.000000000 +0200
@@ -1,6 +1,7 @@
 /****************************************************************************
 **
 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2010 Stephen Kelly <[email protected]>
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the test suite of the Qt Toolkit.
@@ -23,12 +24,18 @@
 #include <QtCore/QAbstractItemModel>
 #include <QtCore/QStack>
 
-class ModelTest : public QObject
+class  ModelTest : public QObject
 {
   Q_OBJECT
 
 public:
+  enum Mode {
+    Normal,
+    Pedantic
+  };
+
   ModelTest( QAbstractItemModel *model, QObject *parent = 0 );
+  ModelTest( QAbstractItemModel *model, Mode testType, QObject *parent = 0 );
 
 private Q_SLOTS:
   void nonDestructiveBasicTest();
@@ -43,17 +50,43 @@
   void runAllTests();
   void layoutAboutToBeChanged();
   void layoutChanged();
+  void modelAboutToBeReset();
+  void modelReset();
   void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end );
   void rowsInserted( const QModelIndex & parent, int start, int end );
   void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end );
   void rowsRemoved( const QModelIndex & parent, int start, int end );
+  void rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, 
int);
+  void rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
   void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
   void headerDataChanged(Qt::Orientation orientation, int start, int end);
 
+  void ensureConsistent();
+  void ensureSteady();
+
 private:
   void checkChildren( const QModelIndex &parent, int currentDepth = 0 );
-
-  QAbstractItemModel *model;
+  void refreshStatus();
+  void persistStatus(const QModelIndex &index);
+  void init();
+
+  QAbstractItemModel * const model;
+
+  struct Status {
+    enum Type {
+      Idle,
+      InsertingRows,
+      RemovingRows,
+      MovingRows,
+      ChangingLayout,
+      Resetting
+    };
+
+    Type type;
+
+    QList<QPersistentModelIndex> persistent;
+    QList<QModelIndex> nonPersistent;
+  } status;
 
   struct Changing {
     QModelIndex parent;
@@ -65,6 +98,7 @@
   QStack<Changing> remove;
 
   bool fetchingMore;
+  const bool pedantic;
 
   QList<QPersistentModelIndex> changing;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-4.98.0/kitemmodels.yaml 
new/kitemmodels-4.99.0/kitemmodels.yaml
--- old/kitemmodels-4.98.0/kitemmodels.yaml     2014-03-28 19:35:13.000000000 
+0100
+++ new/kitemmodels-4.99.0/kitemmodels.yaml     1970-01-01 01:00:00.000000000 
+0100
@@ -1 +0,0 @@
-tier: 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-4.98.0/metainfo.yaml 
new/kitemmodels-4.99.0/metainfo.yaml
--- old/kitemmodels-4.98.0/metainfo.yaml        1970-01-01 01:00:00.000000000 
+0100
+++ new/kitemmodels-4.99.0/metainfo.yaml        2014-05-04 20:59:51.000000000 
+0200
@@ -0,0 +1,9 @@
+maintainer:
+description: Models for Qt Model/View system
+tier: 1
+type: functional
+platforms:
+    - name: All
+portingAid: false
+deprecated: false
+release: true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-4.98.0/src/CMakeLists.txt 
new/kitemmodels-4.99.0/src/CMakeLists.txt
--- old/kitemmodels-4.98.0/src/CMakeLists.txt   2014-03-28 19:35:13.000000000 
+0100
+++ new/kitemmodels-4.99.0/src/CMakeLists.txt   2014-05-04 20:59:51.000000000 
+0200
@@ -13,7 +13,7 @@
 generate_export_header(KF5ItemModels BASE_NAME KItemModels)
 add_library(KF5::ItemModels ALIAS KF5ItemModels)
 
-target_include_directories(KF5ItemModels INTERFACE 
"$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/KItemModels>")
+target_include_directories(KF5ItemModels INTERFACE 
"$<INSTALL_INTERFACE:${KF5_INCLUDE_INSTALL_DIR}/KItemModels>")
 
 target_link_libraries(KF5ItemModels PUBLIC Qt5::Core)
 
@@ -35,14 +35,14 @@
   REQUIRED_HEADERS KItemModels_HEADERS
 )
 
-install(TARGETS KF5ItemModels EXPORT KF5ItemModelsTargets 
${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS KF5ItemModels EXPORT KF5ItemModelsTargets 
${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
 
 install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kitemmodels_export.h
   ${KItemModels_HEADERS}
-  DESTINATION ${INCLUDE_INSTALL_DIR}/KItemModels COMPONENT Devel
+  DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KItemModels COMPONENT Devel
 )
 
 include(ECMGeneratePriFile)
-ecm_generate_pri_file(BASE_NAME KItemModels LIB_NAME KF5ItemModels DEPS "core" 
FILENAME_VAR PRI_FILENAME)
+ecm_generate_pri_file(BASE_NAME KItemModels LIB_NAME KF5ItemModels DEPS "core" 
FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR 
${KF5_INCLUDE_INSTALL_DIR}/KItemModels)
 install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-4.98.0/src/kselectionproxymodel.cpp 
new/kitemmodels-4.99.0/src/kselectionproxymodel.cpp
--- old/kitemmodels-4.98.0/src/kselectionproxymodel.cpp 2014-03-28 
19:35:13.000000000 +0100
+++ new/kitemmodels-4.99.0/src/kselectionproxymodel.cpp 2014-05-04 
20:59:51.000000000 +0200
@@ -1317,6 +1317,9 @@
     Q_UNUSED(srcEnd)
     Q_UNUSED(destParent)
     Q_UNUSED(destRow)
+    // we cheat and just act like the layout changed; this might benefit from 
some
+    // optimization
+    sourceLayoutAboutToBeChanged();
 }
 
 void KSelectionProxyModelPrivate::sourceRowsMoved(const QModelIndex 
&srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int 
destRow)
@@ -1326,6 +1329,9 @@
     Q_UNUSED(srcEnd)
     Q_UNUSED(destParent)
     Q_UNUSED(destRow)
+    // we cheat and just act like the layout changed; this might benefit from 
some
+    // optimization
+    sourceLayoutChanged();
 }
 
 QModelIndex KSelectionProxyModelPrivate::mapParentToSource(const QModelIndex 
&proxyParent) const
@@ -2175,10 +2181,10 @@
                    this, 
SLOT(sourceRowsAboutToBeRemoved(QModelIndex,int,int)));
         disconnect(_sourceModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
                    this, SLOT(sourceRowsRemoved(QModelIndex,int,int)));
-//     disconnect(_sourceModel, 
SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
-//             this, 
SLOT(sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
-//     disconnect(_sourceModel, 
SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
-//             this, 
SLOT(sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)));
+        disconnect(_sourceModel, 
SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+                   this, 
SLOT(sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+        disconnect(_sourceModel, 
SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+                   this, 
SLOT(sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)));
         disconnect(_sourceModel, SIGNAL(modelAboutToBeReset()),
                    this, SLOT(sourceModelAboutToBeReset()));
         disconnect(_sourceModel, SIGNAL(modelReset()),
@@ -2210,10 +2216,10 @@
                 SLOT(sourceRowsAboutToBeRemoved(QModelIndex,int,int)));
         connect(_sourceModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
                 SLOT(sourceRowsRemoved(QModelIndex,int,int)));
-//     connect(_sourceModel, 
SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
-//             
SLOT(sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
-//     connect(_sourceModel, 
SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
-//             SLOT(sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)));
+        connect(_sourceModel, 
SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+                
SLOT(sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+        connect(_sourceModel, 
SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+                SLOT(sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)));
         connect(_sourceModel, SIGNAL(modelAboutToBeReset()),
                 SLOT(sourceModelAboutToBeReset()));
         connect(_sourceModel, SIGNAL(modelReset()),

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to