From kde-commits Sat Dec 31 17:36:39 2011 From: Gilles Caulier Date: Sat, 31 Dec 2011 17:36:39 +0000 To: kde-commits Subject: [kipi-plugins] gpssync/borrowed: use moc file Message-Id: <20111231173639.EA53CA60A6 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132535314404759 Git commit 1566b09150052fd4bc346718e3bcd4cdaed1a211 by Gilles Caulier. Committed on 31/12/2011 at 18:36. Pushed by cgilles into branch 'master'. use moc file M +2 -5 gpssync/borrowed/modeltest.cpp M +18 -11 gpssync/borrowed/modeltest.h http://commits.kde.org/kipi-plugins/1566b09150052fd4bc346718e3bcd4cdaed1a211 diff --git a/gpssync/borrowed/modeltest.cpp b/gpssync/borrowed/modeltest.cpp index e41a12a..7d711b5 100644 --- a/gpssync/borrowed/modeltest.cpp +++ b/gpssync/borrowed/modeltest.cpp @@ -39,12 +39,11 @@ ** **************************************************************************= **/ = +#include "modeltest.moc" = #include - -#include "modeltest.h" - #include + #undef Q_ASSERT #define Q_ASSERT QVERIFY = @@ -562,5 +561,3 @@ void ModelTest::rowsRemoved ( const QModelIndex & paren= t, int start, int end ) Q_ASSERT ( c.last =3D=3D model->data ( model->index ( start - 1, 0, c.= parent ) ) ); Q_ASSERT ( c.next =3D=3D model->data ( model->index ( start, 0, c.pare= nt ) ) ); } - - diff --git a/gpssync/borrowed/modeltest.h b/gpssync/borrowed/modeltest.h index e4ef478..ec23592 100644 --- a/gpssync/borrowed/modeltest.h +++ b/gpssync/borrowed/modeltest.h @@ -39,7 +39,6 @@ ** **************************************************************************= **/ = - #ifndef MODELTEST_H #define MODELTEST_H = @@ -52,9 +51,11 @@ class ModelTest : public QObject Q_OBJECT = public: + ModelTest( QAbstractItemModel *model, QObject *parent =3D 0 ); = private Q_SLOTS: + void nonDestructiveBasicTest(); void rowCount(); void columnCount(); @@ -64,6 +65,7 @@ private Q_SLOTS: void data(); = protected Q_SLOTS: + void runAllTests(); void layoutAboutToBeChanged(); void layoutChanged(); @@ -73,22 +75,27 @@ protected Q_SLOTS: void rowsRemoved( const QModelIndex & parent, int start, int end ); = private: + void checkChildren( const QModelIndex &parent, int currentDepth =3D 0 ); = - QAbstractItemModel *model; +private: = - struct Changing { - QModelIndex parent; - int oldSize; - QVariant last; - QVariant next; + struct Changing + { + QModelIndex parent; + int oldSize; + QVariant last; + QVariant next; }; - QStack insert; - QStack remove; = - bool fetchingMore; + QAbstractItemModel* model; + + QStack insert; + QStack remove; + + bool fetchingMore; = QList changing; }; = -#endif +#endif // MODELTEST_H