11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 * Version : %version: 1 % |
16 * Version : %version: 3 % |
17 */ |
17 */ |
18 #include "cacheproxyhelper.h" |
18 #include "cacheproxyhelper.h" |
|
19 #include <QtTest/QtTest> |
|
20 |
19 |
21 |
20 CacheProxyHelper::CacheProxyHelper(HgCacheProxyModel *model, QObject *parent): |
22 CacheProxyHelper::CacheProxyHelper(HgCacheProxyModel *model, QObject *parent): |
21 QObject(parent), |
23 QObject(parent), |
22 mModel(model) |
24 mModel(model) |
23 { |
25 { |
24 ASSERT(mModel!=0); |
26 ASSERT(mModel!=0); |
|
27 bool res; |
25 |
28 |
26 connect(mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), |
29 res = connect(mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), |
27 this, SLOT(slotDataChanged(QModelIndex,QModelIndex))); |
30 this, SLOT(slotDataChanged(QModelIndex,QModelIndex))); |
28 |
31 QCOMPARE(res, true); |
29 connect(mModel, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), |
32 |
|
33 res = connect(mModel, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), |
30 this, SLOT(slotHeaderDataChanged(Qt::Orientation,int,int))); |
34 this, SLOT(slotHeaderDataChanged(Qt::Orientation,int,int))); |
31 |
35 QCOMPARE(res, true); |
32 connect(mModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), |
36 |
|
37 res = connect(mModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), |
33 this, SLOT(slotRowsAboutToBeInserted(QModelIndex,int,int))); |
38 this, SLOT(slotRowsAboutToBeInserted(QModelIndex,int,int))); |
34 |
39 QCOMPARE(res, true); |
35 connect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), |
40 |
|
41 res = connect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), |
36 this, SLOT(slotRowsInserted(QModelIndex,int,int))); |
42 this, SLOT(slotRowsInserted(QModelIndex,int,int))); |
37 |
43 QCOMPARE(res, true); |
38 connect(mModel, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), |
44 |
|
45 res = connect(mModel, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), |
39 this, SLOT(slotColumnsAboutToBeInserted(QModelIndex,int,int))); |
46 this, SLOT(slotColumnsAboutToBeInserted(QModelIndex,int,int))); |
40 |
47 QCOMPARE(res, true); |
41 connect(mModel, SIGNAL(columnsInserted(QModelIndex,int,int)), |
48 |
|
49 res = connect(mModel, SIGNAL(columnsInserted(QModelIndex,int,int)), |
42 this, SLOT(slotColumnsInserted(QModelIndex,int,int))); |
50 this, SLOT(slotColumnsInserted(QModelIndex,int,int))); |
43 |
51 QCOMPARE(res, true); |
44 connect(mModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), |
52 |
|
53 res = connect(mModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), |
45 this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); |
54 this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); |
46 |
55 QCOMPARE(res, true); |
47 connect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), |
56 |
|
57 res = connect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), |
48 this, SLOT(slotRowsRemoved(QModelIndex,int,int))); |
58 this, SLOT(slotRowsRemoved(QModelIndex,int,int))); |
49 |
59 QCOMPARE(res, true); |
50 connect(mModel, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), |
60 |
|
61 res = connect(mModel, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), |
51 this, SLOT(slotColumnsAboutToBeRemoved(QModelIndex,int,int))); |
62 this, SLOT(slotColumnsAboutToBeRemoved(QModelIndex,int,int))); |
52 |
63 QCOMPARE(res, true); |
53 connect(mModel, SIGNAL(columnsRemoved(QModelIndex,int,int)), |
64 |
|
65 res = connect(mModel, SIGNAL(columnsRemoved(QModelIndex,int,int)), |
54 this, SLOT(slotColumnsRemoved(QModelIndex,int,int))); |
66 this, SLOT(slotColumnsRemoved(QModelIndex,int,int))); |
55 |
67 QCOMPARE(res, true); |
56 connect(mModel, SIGNAL(layoutAboutToBeChanged()), |
68 |
|
69 res = connect(mModel, SIGNAL(layoutAboutToBeChanged()), |
57 this, SLOT(slotLayoutAboutToBeChanged())); |
70 this, SLOT(slotLayoutAboutToBeChanged())); |
58 |
71 QCOMPARE(res, true); |
59 connect(mModel, SIGNAL(layoutChanged()), |
72 |
|
73 res = connect(mModel, SIGNAL(layoutChanged()), |
60 this, SLOT(slotLayoutChanged())); |
74 this, SLOT(slotLayoutChanged())); |
61 |
75 QCOMPARE(res, true); |
62 connect(mModel, SIGNAL(modelAboutToBeReset()), |
76 |
|
77 res = connect(mModel, SIGNAL(modelAboutToBeReset()), |
63 this, SLOT(slotModelAboutToBeReset())); |
78 this, SLOT(slotModelAboutToBeReset())); |
64 |
79 QCOMPARE(res, true); |
65 connect(mModel, SIGNAL(modelReset()), |
80 |
|
81 res = connect(mModel, SIGNAL(modelReset()), |
66 this, SLOT(slotModelReset())); |
82 this, SLOT(slotModelReset())); |
67 |
83 QCOMPARE(res, true); |
|
84 |
|
85 res = connect(mModel, SIGNAL(rowsAboutToBeMoved(const QModelIndex&, int, int, const QModelIndex&, int)), |
|
86 this, SLOT(slotRowsAboutToBeMoved(const QModelIndex&, int, int, const QModelIndex&, int))); |
|
87 QCOMPARE(res, true); |
|
88 |
|
89 res = connect(mModel, SIGNAL(rowsMoved(const QModelIndex&, int, int, const QModelIndex&, int)), |
|
90 this, SLOT(slotRowsMoved(const QModelIndex&, int, int, const QModelIndex&, int))); |
|
91 QCOMPARE(res, true); |
|
92 |
|
93 res = connect(mModel, SIGNAL(columnsAboutToBeMoved(const QModelIndex&, int, int, const QModelIndex&, int)), |
|
94 this, SLOT(slotColumnsAboutToBeMoved(const QModelIndex&, int, int, const QModelIndex&, int))); |
|
95 QCOMPARE(res, true); |
|
96 |
|
97 res = connect(mModel, SIGNAL(columnsMoved(const QModelIndex&, int, int, const QModelIndex&, int)), |
|
98 this, SLOT(slotColumnsMoved(const QModelIndex&, int, int, const QModelIndex&, int))); |
|
99 QCOMPARE(res, true); |
|
100 |
68 } |
101 } |
69 |
102 |
70 CacheProxyHelper::~CacheProxyHelper() |
103 CacheProxyHelper::~CacheProxyHelper() |
71 { |
104 { |
72 disconnect(mModel); |
105 disconnect(mModel); |