]> cloud.milkyroute.net Git - dolphin.git/blob - src/tests/kitemlistselectionmanagertest.cpp
Merge remote-tracking branch 'origin/Applications/17.04'
[dolphin.git] / src / tests / kitemlistselectionmanagertest.cpp
1 /***************************************************************************
2 * Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com> *
3 * Copyright (C) 2011 by Frank Reininghaus <frank78ac@googlemail.com> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #include "kitemviews/kitemmodelbase.h"
22 #include "kitemviews/kitemlistselectionmanager.h"
23
24 #include <QTest>
25 #include <QSignalSpy>
26
27 class DummyModel : public KItemModelBase
28 {
29 Q_OBJECT
30 public:
31 DummyModel();
32 void setCount(int count);
33 int count() const Q_DECL_OVERRIDE;
34 QHash<QByteArray, QVariant> data(int index) const Q_DECL_OVERRIDE;
35
36 private:
37 int m_count;
38 };
39
40 DummyModel::DummyModel() :
41 KItemModelBase(),
42 m_count(100)
43 {
44 }
45
46 void DummyModel::setCount(int count)
47 {
48 m_count = count;
49 }
50
51 int DummyModel::count() const
52 {
53 return m_count;
54 }
55
56 QHash<QByteArray, QVariant> DummyModel::data(int index) const
57 {
58 Q_UNUSED(index);
59 return QHash<QByteArray, QVariant>();
60 }
61
62
63 class KItemListSelectionManagerTest : public QObject
64 {
65 Q_OBJECT
66
67 private slots:
68 void init();
69 void cleanup();
70
71 void testConstructor();
72
73 void testCurrentItemAnchorItem();
74 void testSetSelected_data();
75 void testSetSelected();
76 void testItemsInserted();
77 void testItemsRemoved();
78 void testAnchoredSelection();
79 void testChangeSelection_data();
80 void testChangeSelection();
81 void testDeleteCurrentItem_data();
82 void testDeleteCurrentItem();
83 void testAnchoredSelectionAfterMovingItems();
84
85 private:
86 void verifySelectionChange(QSignalSpy& spy, const KItemSet& currentSelection, const KItemSet& previousSelection) const;
87
88 KItemListSelectionManager* m_selectionManager;
89 DummyModel* m_model;
90 };
91
92 void KItemListSelectionManagerTest::init()
93 {
94 m_model = new DummyModel();
95 m_selectionManager = new KItemListSelectionManager();
96 m_selectionManager->setModel(m_model);
97 }
98
99 void KItemListSelectionManagerTest::cleanup()
100 {
101 delete m_selectionManager;
102 m_selectionManager = 0;
103
104 delete m_model;
105 m_model = 0;
106 }
107
108 void KItemListSelectionManagerTest::testConstructor()
109 {
110 QVERIFY(!m_selectionManager->hasSelection());
111 QCOMPARE(m_selectionManager->selectedItems().count(), 0);
112 QCOMPARE(m_selectionManager->currentItem(), 0);
113 QCOMPARE(m_selectionManager->m_anchorItem, -1);
114 }
115
116 void KItemListSelectionManagerTest::testCurrentItemAnchorItem()
117 {
118 QSignalSpy spyCurrent(m_selectionManager, SIGNAL(currentChanged(int,int)));
119
120 // Set current item and check that the selection manager emits the currentChanged(int,int) signal correctly.
121 m_selectionManager->setCurrentItem(4);
122 QCOMPARE(m_selectionManager->currentItem(), 4);
123 QCOMPARE(spyCurrent.count(), 1);
124 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 4);
125 spyCurrent.takeFirst();
126
127 // Begin an anchored selection.
128 m_selectionManager->beginAnchoredSelection(5);
129 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
130 QCOMPARE(m_selectionManager->m_anchorItem, 5);
131
132 // Items between current and anchor should be selected now
133 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 4 << 5);
134 QVERIFY(m_selectionManager->hasSelection());
135
136 // Change current item again and check the selection
137 m_selectionManager->setCurrentItem(2);
138 QCOMPARE(m_selectionManager->currentItem(), 2);
139 QCOMPARE(spyCurrent.count(), 1);
140 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 2);
141 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 4);
142 spyCurrent.takeFirst();
143
144 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 2 << 3 << 4 << 5);
145 QVERIFY(m_selectionManager->hasSelection());
146
147 // Inserting items should update current item and anchor item.
148 m_selectionManager->itemsInserted(KItemRangeList() <<
149 KItemRange(0, 1) <<
150 KItemRange(2, 2) <<
151 KItemRange(6, 3));
152
153 QCOMPARE(m_selectionManager->currentItem(), 5);
154 QCOMPARE(spyCurrent.count(), 1);
155 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 5);
156 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 2);
157 spyCurrent.takeFirst();
158
159 QCOMPARE(m_selectionManager->m_anchorItem, 8);
160
161 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 8);
162 QVERIFY(m_selectionManager->hasSelection());
163
164 // Removing items should update current item and anchor item.
165 m_selectionManager->itemsRemoved(KItemRangeList() <<
166 KItemRange(0, 2) <<
167 KItemRange(2, 1) <<
168 KItemRange(9, 2));
169
170 QCOMPARE(m_selectionManager->currentItem(), 2);
171 QCOMPARE(spyCurrent.count(), 1);
172 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 2);
173 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 5);
174 spyCurrent.takeFirst();
175
176 QCOMPARE(m_selectionManager->m_anchorItem, 5);
177
178 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 2 << 3 << 4 << 5);
179 QVERIFY(m_selectionManager->hasSelection());
180
181 // Verify that clearSelection() also clears the anchored selection.
182 m_selectionManager->clearSelection();
183 QCOMPARE(m_selectionManager->selectedItems(), KItemSet());
184 QVERIFY(!m_selectionManager->hasSelection());
185
186 m_selectionManager->endAnchoredSelection();
187 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
188 }
189
190 void KItemListSelectionManagerTest::testSetSelected_data()
191 {
192 QTest::addColumn<int>("index");
193 QTest::addColumn<int>("count");
194 QTest::addColumn<int>("expectedSelectionCount");
195
196 QTest::newRow("Select all") << 0 << 100 << 100;
197 QTest::newRow("Sub selection 15 items") << 20 << 15 << 15;
198 QTest::newRow("Sub selection 1 item") << 20 << 1 << 1;
199 QTest::newRow("Too small index") << -1 << 100 << 0;
200 QTest::newRow("Too large index") << 100 << 100 << 0;
201 QTest::newRow("Too large count") << 0 << 100000 << 100;
202 QTest::newRow("Too small count") << 0 << 0 << 0;
203 }
204
205 void KItemListSelectionManagerTest::testSetSelected()
206 {
207 QFETCH(int, index);
208 QFETCH(int, count);
209 QFETCH(int, expectedSelectionCount);
210 m_selectionManager->setSelected(index, count);
211 QCOMPARE(m_selectionManager->selectedItems().count(), expectedSelectionCount);
212 }
213
214 void KItemListSelectionManagerTest::testItemsInserted()
215 {
216 // Select items 10 to 12
217 m_selectionManager->setSelected(10, 3);
218 KItemSet selectedItems = m_selectionManager->selectedItems();
219 QCOMPARE(selectedItems.count(), 3);
220 QVERIFY(selectedItems.contains(10));
221 QVERIFY(selectedItems.contains(11));
222 QVERIFY(selectedItems.contains(12));
223
224 // Insert items 0 to 4 -> selection must be 15 to 17
225 m_selectionManager->itemsInserted(KItemRangeList() << KItemRange(0, 5));
226 selectedItems = m_selectionManager->selectedItems();
227 QCOMPARE(selectedItems.count(), 3);
228 QVERIFY(selectedItems.contains(15));
229 QVERIFY(selectedItems.contains(16));
230 QVERIFY(selectedItems.contains(17));
231
232 // Insert 3 items between the selections
233 m_selectionManager->itemsInserted(KItemRangeList() <<
234 KItemRange(15, 1) <<
235 KItemRange(16, 1) <<
236 KItemRange(17, 1));
237 selectedItems = m_selectionManager->selectedItems();
238 QCOMPARE(selectedItems.count(), 3);
239 QVERIFY(selectedItems.contains(16));
240 QVERIFY(selectedItems.contains(18));
241 QVERIFY(selectedItems.contains(20));
242 }
243
244 void KItemListSelectionManagerTest::testItemsRemoved()
245 {
246 // Select items 10 to 15
247 m_selectionManager->setSelected(10, 6);
248 KItemSet selectedItems = m_selectionManager->selectedItems();
249 QCOMPARE(selectedItems.count(), 6);
250 for (int i = 10; i <= 15; ++i) {
251 QVERIFY(selectedItems.contains(i));
252 }
253
254 // Remove items 0 to 4 -> selection must be 5 to 10
255 m_selectionManager->itemsRemoved(KItemRangeList() << KItemRange(0, 5));
256 selectedItems = m_selectionManager->selectedItems();
257 QCOMPARE(selectedItems.count(), 6);
258 for (int i = 5; i <= 10; ++i) {
259 QVERIFY(selectedItems.contains(i));
260 }
261
262 // Remove the items 6 , 8 and 10
263 m_selectionManager->itemsRemoved(KItemRangeList() <<
264 KItemRange(6, 1) <<
265 KItemRange(8, 1) <<
266 KItemRange(10, 1));
267 selectedItems = m_selectionManager->selectedItems();
268 QCOMPARE(selectedItems.count(), 3);
269 QVERIFY(selectedItems.contains(5));
270 QVERIFY(selectedItems.contains(6));
271 QVERIFY(selectedItems.contains(7));
272 }
273
274 void KItemListSelectionManagerTest::testAnchoredSelection()
275 {
276 m_selectionManager->beginAnchoredSelection(5);
277 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
278 QCOMPARE(m_selectionManager->m_anchorItem, 5);
279
280 m_selectionManager->setCurrentItem(6);
281 QCOMPARE(m_selectionManager->currentItem(), 6);
282 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6);
283
284 m_selectionManager->setCurrentItem(4);
285 QCOMPARE(m_selectionManager->currentItem(), 4);
286 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 4 << 5);
287
288 m_selectionManager->setCurrentItem(7);
289 QCOMPARE(m_selectionManager->currentItem(), 7);
290 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7);
291
292 // Ending the anchored selection should not change the selected items.
293 m_selectionManager->endAnchoredSelection();
294 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
295 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7);
296
297 // Start a new anchored selection that overlaps the previous one
298 m_selectionManager->beginAnchoredSelection(9);
299 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
300 QCOMPARE(m_selectionManager->m_anchorItem, 9);
301
302 m_selectionManager->setCurrentItem(6);
303 QCOMPARE(m_selectionManager->currentItem(), 6);
304 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 8 << 9);
305
306 m_selectionManager->setCurrentItem(10);
307 QCOMPARE(m_selectionManager->currentItem(), 10);
308 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 9 << 10);
309
310 m_selectionManager->endAnchoredSelection();
311 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
312 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 9 << 10);
313 }
314
315 namespace {
316 enum ChangeType {
317 NoChange,
318 InsertItems,
319 RemoveItems,
320 MoveItems,
321 EndAnchoredSelection,
322 SetSelected
323 };
324 }
325
326 Q_DECLARE_METATYPE(KItemSet)
327 Q_DECLARE_METATYPE(ChangeType)
328 Q_DECLARE_METATYPE(KItemRange)
329 Q_DECLARE_METATYPE(KItemRangeList)
330 Q_DECLARE_METATYPE(KItemListSelectionManager::SelectionMode)
331 Q_DECLARE_METATYPE(QList<int>)
332
333 /**
334 * The following function provides a generic way to test the selection functionality.
335 *
336 * The test is data-driven and takes the following arguments:
337 *
338 * param initialSelection The selection at the beginning.
339 * param anchor This item will be the anchor item.
340 * param current This item will be the current item.
341 * param expectedSelection Expected selection after anchor and current are set.
342 * param changeType Type of the change that is done then:
343 * - NoChange
344 * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
345 * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
346 * - MoveItems -> data.at(0) provides the KItemRange containing the original indices,
347 * data.at(1) provides the list containing the new indices
348 * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
349 * - EndAnchoredSelection
350 * - SetSelected -> data.at(0) provides the index where the selection process starts,
351 * data.at(1) provides the number of indices to be selected,
352 * data.at(2) provides the selection mode.
353 * \sa KItemListSelectionManager::setSelected()
354 * param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
355 * param finalSelection The expected final selection.
356 *
357 */
358 void KItemListSelectionManagerTest::testChangeSelection_data()
359 {
360 QTest::addColumn<KItemSet>("initialSelection");
361 QTest::addColumn<int>("anchor");
362 QTest::addColumn<int>("current");
363 QTest::addColumn<KItemSet>("expectedSelection");
364 QTest::addColumn<ChangeType>("changeType");
365 QTest::addColumn<QList<QVariant> >("data");
366 QTest::addColumn<KItemSet>("finalSelection");
367
368 QTest::newRow("No change")
369 << (KItemSet() << 5 << 6)
370 << 2 << 3
371 << (KItemSet() << 2 << 3 << 5 << 6)
372 << NoChange
373 << QList<QVariant>{}
374 << (KItemSet() << 2 << 3 << 5 << 6);
375
376 QTest::newRow("Insert Items")
377 << (KItemSet() << 5 << 6)
378 << 2 << 3
379 << (KItemSet() << 2 << 3 << 5 << 6)
380 << InsertItems
381 << QList<QVariant>{QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 2) << KItemRange(10, 5))}
382 << (KItemSet() << 3 << 4 << 8 << 9);
383
384 QTest::newRow("Remove Items")
385 << (KItemSet() << 5 << 6)
386 << 2 << 3
387 << (KItemSet() << 2 << 3 << 5 << 6)
388 << RemoveItems
389 << QList<QVariant>{QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(3, 1) << KItemRange(10, 5))}
390 << (KItemSet() << 1 << 2 << 3 << 4);
391
392 QTest::newRow("Empty Anchored Selection")
393 << KItemSet()
394 << 2 << 2
395 << KItemSet()
396 << EndAnchoredSelection
397 << QList<QVariant>{}
398 << KItemSet();
399
400 QTest::newRow("Toggle selection")
401 << (KItemSet() << 1 << 3 << 4)
402 << 6 << 8
403 << (KItemSet() << 1 << 3 << 4 << 6 << 7 << 8)
404 << SetSelected
405 << QList<QVariant>{0, 10, QVariant::fromValue(KItemListSelectionManager::Toggle)}
406 << (KItemSet() << 0 << 2 << 5 << 9);
407
408 // Swap items 2, 3 and 4, 5
409 QTest::newRow("Move items")
410 << (KItemSet() << 0 << 1 << 2 << 3)
411 << -1 << -1
412 << (KItemSet() << 0 << 1 << 2 << 3)
413 << MoveItems
414 << QList<QVariant>{QVariant::fromValue(KItemRange(2, 4)),
415 QVariant::fromValue(QList<int>{4, 5, 2, 3})}
416 << (KItemSet() << 0 << 1 << 4 << 5);
417
418 QTest::newRow("Move items with active anchored selection")
419 << KItemSet()
420 << 0 << 3
421 << (KItemSet() << 0 << 1 << 2 << 3)
422 << MoveItems
423 << QList<QVariant>{QVariant::fromValue(KItemRange(2, 4)),
424 QVariant::fromValue(QList<int>{4, 5, 2, 3})}
425 << (KItemSet() << 0 << 1 << 4 << 5);
426
427 // Revert sort order
428 QTest::newRow("Revert sort order")
429 << (KItemSet() << 0 << 1)
430 << 3 << 4
431 << (KItemSet() << 0 << 1 << 3 << 4)
432 << MoveItems
433 << QList<QVariant>{QVariant::fromValue(KItemRange(0, 10)),
434 QVariant::fromValue(QList<int>{9, 8, 7, 6, 5, 4, 3, 2, 1, 0})}
435 << (KItemSet() << 5 << 6 << 8 << 9);
436 }
437
438 void KItemListSelectionManagerTest::testChangeSelection()
439 {
440 QFETCH(KItemSet, initialSelection);
441 QFETCH(int, anchor);
442 QFETCH(int, current);
443 QFETCH(KItemSet, expectedSelection);
444 QFETCH(ChangeType, changeType);
445 QFETCH(QList<QVariant>, data);
446 QFETCH(KItemSet, finalSelection);
447
448 QSignalSpy spySelectionChanged(m_selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)));
449
450 // Initial selection should be empty
451 QVERIFY(!m_selectionManager->hasSelection());
452 QVERIFY(m_selectionManager->selectedItems().isEmpty());
453
454 // Perform the initial selectiion
455 m_selectionManager->setSelectedItems(initialSelection);
456
457 verifySelectionChange(spySelectionChanged, initialSelection, KItemSet());
458
459 // Perform an anchored selection.
460 // Note that current and anchor index are equal first because this is the case in typical uses of the
461 // selection manager, and because this makes it easier to test the correctness of the signal's arguments.
462 m_selectionManager->setCurrentItem(anchor);
463 m_selectionManager->beginAnchoredSelection(anchor);
464 m_selectionManager->setCurrentItem(current);
465 QCOMPARE(m_selectionManager->m_anchorItem, anchor);
466 QCOMPARE(m_selectionManager->currentItem(), current);
467
468 verifySelectionChange(spySelectionChanged, expectedSelection, initialSelection);
469
470 // Change the model by inserting or removing items.
471 switch (changeType) {
472 case InsertItems:
473 m_selectionManager->itemsInserted(data.at(0).value<KItemRangeList>());
474 break;
475 case RemoveItems:
476 m_selectionManager->itemsRemoved(data.at(0).value<KItemRangeList>());
477 break;
478 case MoveItems:
479 m_selectionManager->itemsMoved(data.at(0).value<KItemRange>(),
480 data.at(1).value<QList<int>>());
481 break;
482 case EndAnchoredSelection:
483 m_selectionManager->endAnchoredSelection();
484 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
485 break;
486 case SetSelected:
487 m_selectionManager->setSelected(data.at(0).value<int>(), // index
488 data.at(1).value<int>(), // count
489 data.at(2).value<KItemListSelectionManager::SelectionMode>());
490 break;
491 case NoChange:
492 break;
493 }
494
495 verifySelectionChange(spySelectionChanged, finalSelection, expectedSelection);
496
497 // Finally, clear the selection
498 m_selectionManager->clearSelection();
499
500 verifySelectionChange(spySelectionChanged, KItemSet(), finalSelection);
501 }
502
503 void KItemListSelectionManagerTest::testDeleteCurrentItem_data()
504 {
505 QTest::addColumn<int>("oldCurrentItemIndex");
506 QTest::addColumn<int>("removeIndex");
507 QTest::addColumn<int>("removeCount");
508 QTest::addColumn<int>("newCurrentItemIndex");
509
510 QTest::newRow("Remove before") << 50 << 0 << 10 << 40;
511 QTest::newRow("Remove after") << 50 << 51 << 10 << 50;
512 QTest::newRow("Remove exactly current item") << 50 << 50 << 1 << 50;
513 QTest::newRow("Remove around current item") << 50 << 45 << 10 << 45;
514 QTest::newRow("Remove all except one item") << 50 << 1 << 99 << 0;
515 }
516
517 void KItemListSelectionManagerTest::testDeleteCurrentItem()
518 {
519 QFETCH(int, oldCurrentItemIndex);
520 QFETCH(int, removeIndex);
521 QFETCH(int, removeCount);
522 QFETCH(int, newCurrentItemIndex);
523
524 m_selectionManager->setCurrentItem(oldCurrentItemIndex);
525
526 const int newCount = m_model->count() - removeCount;
527 m_model->setCount(newCount);
528 m_selectionManager->itemsRemoved(KItemRangeList() << KItemRange(removeIndex, removeCount));
529
530 QCOMPARE(m_selectionManager->currentItem(), newCurrentItemIndex);
531 }
532
533 void KItemListSelectionManagerTest::testAnchoredSelectionAfterMovingItems()
534 {
535 m_selectionManager->setCurrentItem(4);
536 m_selectionManager->beginAnchoredSelection(4);
537
538 // Reverse the items between 0 and 5.
539 m_selectionManager->itemsMoved(KItemRange(0, 6), {5, 4, 3, 2, 1, 0});
540
541 QCOMPARE(m_selectionManager->currentItem(), 1);
542 QCOMPARE(m_selectionManager->m_anchorItem, 1);
543
544 // Make 2 the current item -> 1 and 2 should be selected.
545 m_selectionManager->setCurrentItem(2);
546 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 1 << 2);
547 }
548
549 void KItemListSelectionManagerTest::verifySelectionChange(QSignalSpy& spy,
550 const KItemSet& currentSelection,
551 const KItemSet& previousSelection) const
552 {
553 QCOMPARE(m_selectionManager->selectedItems(), currentSelection);
554 QCOMPARE(m_selectionManager->hasSelection(), !currentSelection.isEmpty());
555 for (int index = 0; index < m_selectionManager->model()->count(); ++index) {
556 if (currentSelection.contains(index)) {
557 QVERIFY(m_selectionManager->isSelected(index));
558 }
559 else {
560 QVERIFY(!m_selectionManager->isSelected(index));
561 }
562 }
563
564 if (currentSelection == previousSelection) {
565 QCOMPARE(spy.count(), 0);
566 }
567 else {
568 QCOMPARE(spy.count(), 1);
569 QList<QVariant> arguments = spy.takeFirst();
570 QCOMPARE(qvariant_cast<KItemSet>(arguments.at(0)), currentSelection);
571 QCOMPARE(qvariant_cast<KItemSet>(arguments.at(1)), previousSelection);
572 }
573 }
574
575 QTEST_GUILESS_MAIN(KItemListSelectionManagerTest)
576
577 #include "kitemlistselectionmanagertest.moc"