]> cloud.milkyroute.net Git - dolphin.git/blob - src/tests/kitemlistselectionmanagertest.cpp
Merge branch 'frameworks'
[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 public:
30 DummyModel();
31 void setCount(int count);
32 virtual int count() const;
33 virtual QHash<QByteArray, QVariant> data(int index) const;
34
35 private:
36 int m_count;
37 };
38
39 DummyModel::DummyModel() :
40 KItemModelBase(),
41 m_count(100)
42 {
43 }
44
45 void DummyModel::setCount(int count)
46 {
47 m_count = count;
48 }
49
50 int DummyModel::count() const
51 {
52 return m_count;
53 }
54
55 QHash<QByteArray, QVariant> DummyModel::data(int index) const
56 {
57 Q_UNUSED(index);
58 return QHash<QByteArray, QVariant>();
59 }
60
61
62 class KItemListSelectionManagerTest : public QObject
63 {
64 Q_OBJECT
65
66 private slots:
67 void init();
68 void cleanup();
69
70 void testConstructor();
71
72 void testCurrentItemAnchorItem();
73 void testSetSelected_data();
74 void testSetSelected();
75 void testItemsInserted();
76 void testItemsRemoved();
77 void testAnchoredSelection();
78 void testChangeSelection_data();
79 void testChangeSelection();
80 void testDeleteCurrentItem_data();
81 void testDeleteCurrentItem();
82 void testAnchoredSelectionAfterMovingItems();
83
84 private:
85 void verifySelectionChange(QSignalSpy& spy, const KItemSet& currentSelection, const KItemSet& previousSelection) const;
86
87 KItemListSelectionManager* m_selectionManager;
88 DummyModel* m_model;
89 };
90
91 void KItemListSelectionManagerTest::init()
92 {
93 m_model = new DummyModel();
94 m_selectionManager = new KItemListSelectionManager();
95 m_selectionManager->setModel(m_model);
96 }
97
98 void KItemListSelectionManagerTest::cleanup()
99 {
100 delete m_selectionManager;
101 m_selectionManager = 0;
102
103 delete m_model;
104 m_model = 0;
105 }
106
107 void KItemListSelectionManagerTest::testConstructor()
108 {
109 QVERIFY(!m_selectionManager->hasSelection());
110 QCOMPARE(m_selectionManager->selectedItems().count(), 0);
111 QCOMPARE(m_selectionManager->currentItem(), 0);
112 QCOMPARE(m_selectionManager->m_anchorItem, -1);
113 }
114
115 void KItemListSelectionManagerTest::testCurrentItemAnchorItem()
116 {
117 QSignalSpy spyCurrent(m_selectionManager, SIGNAL(currentChanged(int,int)));
118
119 // Set current item and check that the selection manager emits the currentChanged(int,int) signal correctly.
120 m_selectionManager->setCurrentItem(4);
121 QCOMPARE(m_selectionManager->currentItem(), 4);
122 QCOMPARE(spyCurrent.count(), 1);
123 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 4);
124 spyCurrent.takeFirst();
125
126 // Begin an anchored selection.
127 m_selectionManager->beginAnchoredSelection(5);
128 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
129 QCOMPARE(m_selectionManager->m_anchorItem, 5);
130
131 // Items between current and anchor should be selected now
132 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 4 << 5);
133 QVERIFY(m_selectionManager->hasSelection());
134
135 // Change current item again and check the selection
136 m_selectionManager->setCurrentItem(2);
137 QCOMPARE(m_selectionManager->currentItem(), 2);
138 QCOMPARE(spyCurrent.count(), 1);
139 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 2);
140 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 4);
141 spyCurrent.takeFirst();
142
143 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 2 << 3 << 4 << 5);
144 QVERIFY(m_selectionManager->hasSelection());
145
146 // Inserting items should update current item and anchor item.
147 m_selectionManager->itemsInserted(KItemRangeList() <<
148 KItemRange(0, 1) <<
149 KItemRange(2, 2) <<
150 KItemRange(6, 3));
151
152 QCOMPARE(m_selectionManager->currentItem(), 5);
153 QCOMPARE(spyCurrent.count(), 1);
154 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 5);
155 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 2);
156 spyCurrent.takeFirst();
157
158 QCOMPARE(m_selectionManager->m_anchorItem, 8);
159
160 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 8);
161 QVERIFY(m_selectionManager->hasSelection());
162
163 // Removing items should update current item and anchor item.
164 m_selectionManager->itemsRemoved(KItemRangeList() <<
165 KItemRange(0, 2) <<
166 KItemRange(2, 1) <<
167 KItemRange(9, 2));
168
169 QCOMPARE(m_selectionManager->currentItem(), 2);
170 QCOMPARE(spyCurrent.count(), 1);
171 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 2);
172 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 5);
173 spyCurrent.takeFirst();
174
175 QCOMPARE(m_selectionManager->m_anchorItem, 5);
176
177 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 2 << 3 << 4 << 5);
178 QVERIFY(m_selectionManager->hasSelection());
179
180 // Verify that clearSelection() also clears the anchored selection.
181 m_selectionManager->clearSelection();
182 QCOMPARE(m_selectionManager->selectedItems(), KItemSet());
183 QVERIFY(!m_selectionManager->hasSelection());
184
185 m_selectionManager->endAnchoredSelection();
186 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
187 }
188
189 void KItemListSelectionManagerTest::testSetSelected_data()
190 {
191 QTest::addColumn<int>("index");
192 QTest::addColumn<int>("count");
193 QTest::addColumn<int>("expectedSelectionCount");
194
195 QTest::newRow("Select all") << 0 << 100 << 100;
196 QTest::newRow("Sub selection 15 items") << 20 << 15 << 15;
197 QTest::newRow("Sub selection 1 item") << 20 << 1 << 1;
198 QTest::newRow("Too small index") << -1 << 100 << 0;
199 QTest::newRow("Too large index") << 100 << 100 << 0;
200 QTest::newRow("Too large count") << 0 << 100000 << 100;
201 QTest::newRow("Too small count") << 0 << 0 << 0;
202 }
203
204 void KItemListSelectionManagerTest::testSetSelected()
205 {
206 QFETCH(int, index);
207 QFETCH(int, count);
208 QFETCH(int, expectedSelectionCount);
209 m_selectionManager->setSelected(index, count);
210 QCOMPARE(m_selectionManager->selectedItems().count(), expectedSelectionCount);
211 }
212
213 void KItemListSelectionManagerTest::testItemsInserted()
214 {
215 // Select items 10 to 12
216 m_selectionManager->setSelected(10, 3);
217 KItemSet selectedItems = m_selectionManager->selectedItems();
218 QCOMPARE(selectedItems.count(), 3);
219 QVERIFY(selectedItems.contains(10));
220 QVERIFY(selectedItems.contains(11));
221 QVERIFY(selectedItems.contains(12));
222
223 // Insert items 0 to 4 -> selection must be 15 to 17
224 m_selectionManager->itemsInserted(KItemRangeList() << KItemRange(0, 5));
225 selectedItems = m_selectionManager->selectedItems();
226 QCOMPARE(selectedItems.count(), 3);
227 QVERIFY(selectedItems.contains(15));
228 QVERIFY(selectedItems.contains(16));
229 QVERIFY(selectedItems.contains(17));
230
231 // Insert 3 items between the selections
232 m_selectionManager->itemsInserted(KItemRangeList() <<
233 KItemRange(15, 1) <<
234 KItemRange(16, 1) <<
235 KItemRange(17, 1));
236 selectedItems = m_selectionManager->selectedItems();
237 QCOMPARE(selectedItems.count(), 3);
238 QVERIFY(selectedItems.contains(16));
239 QVERIFY(selectedItems.contains(18));
240 QVERIFY(selectedItems.contains(20));
241 }
242
243 void KItemListSelectionManagerTest::testItemsRemoved()
244 {
245 // Select items 10 to 15
246 m_selectionManager->setSelected(10, 6);
247 KItemSet selectedItems = m_selectionManager->selectedItems();
248 QCOMPARE(selectedItems.count(), 6);
249 for (int i = 10; i <= 15; ++i) {
250 QVERIFY(selectedItems.contains(i));
251 }
252
253 // Remove items 0 to 4 -> selection must be 5 to 10
254 m_selectionManager->itemsRemoved(KItemRangeList() << KItemRange(0, 5));
255 selectedItems = m_selectionManager->selectedItems();
256 QCOMPARE(selectedItems.count(), 6);
257 for (int i = 5; i <= 10; ++i) {
258 QVERIFY(selectedItems.contains(i));
259 }
260
261 // Remove the items 6 , 8 and 10
262 m_selectionManager->itemsRemoved(KItemRangeList() <<
263 KItemRange(6, 1) <<
264 KItemRange(8, 1) <<
265 KItemRange(10, 1));
266 selectedItems = m_selectionManager->selectedItems();
267 QCOMPARE(selectedItems.count(), 3);
268 QVERIFY(selectedItems.contains(5));
269 QVERIFY(selectedItems.contains(6));
270 QVERIFY(selectedItems.contains(7));
271 }
272
273 void KItemListSelectionManagerTest::testAnchoredSelection()
274 {
275 m_selectionManager->beginAnchoredSelection(5);
276 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
277 QCOMPARE(m_selectionManager->m_anchorItem, 5);
278
279 m_selectionManager->setCurrentItem(6);
280 QCOMPARE(m_selectionManager->currentItem(), 6);
281 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6);
282
283 m_selectionManager->setCurrentItem(4);
284 QCOMPARE(m_selectionManager->currentItem(), 4);
285 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 4 << 5);
286
287 m_selectionManager->setCurrentItem(7);
288 QCOMPARE(m_selectionManager->currentItem(), 7);
289 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7);
290
291 // Ending the anchored selection should not change the selected items.
292 m_selectionManager->endAnchoredSelection();
293 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
294 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7);
295
296 // Start a new anchored selection that overlaps the previous one
297 m_selectionManager->beginAnchoredSelection(9);
298 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
299 QCOMPARE(m_selectionManager->m_anchorItem, 9);
300
301 m_selectionManager->setCurrentItem(6);
302 QCOMPARE(m_selectionManager->currentItem(), 6);
303 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 8 << 9);
304
305 m_selectionManager->setCurrentItem(10);
306 QCOMPARE(m_selectionManager->currentItem(), 10);
307 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 9 << 10);
308
309 m_selectionManager->endAnchoredSelection();
310 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
311 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 9 << 10);
312 }
313
314 namespace {
315 enum ChangeType {
316 NoChange,
317 InsertItems,
318 RemoveItems,
319 MoveItems,
320 EndAnchoredSelection,
321 SetSelected
322 };
323 }
324
325 Q_DECLARE_METATYPE(KItemSet);
326 Q_DECLARE_METATYPE(ChangeType);
327 Q_DECLARE_METATYPE(KItemRange);
328 Q_DECLARE_METATYPE(KItemRangeList);
329 Q_DECLARE_METATYPE(KItemListSelectionManager::SelectionMode);
330 Q_DECLARE_METATYPE(QList<int>);
331
332 /**
333 * The following function provides a generic way to test the selection functionality.
334 *
335 * The test is data-driven and takes the following arguments:
336 *
337 * \param initialSelection The selection at the beginning.
338 * \param anchor This item will be the anchor item.
339 * \param current This item will be the current item.
340 * \param expectedSelection Expected selection after anchor and current are set.
341 * \param changeType Type of the change that is done then:
342 * - NoChange
343 * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
344 * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
345 * - MoveItems -> data.at(0) provides the KItemRange containing the original indices,
346 * data.at(1) provides the list containing the new indices
347 * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
348 * - EndAnchoredSelection
349 * - SetSelected -> data.at(0) provides the index where the selection process starts,
350 * data.at(1) provides the number of indices to be selected,
351 * data.at(2) provides the selection mode.
352 * \sa KItemListSelectionManager::setSelected()
353 * \param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
354 * \param finalSelection The expected final selection.
355 *
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"