]> cloud.milkyroute.net Git - dolphin.git/blob - src/tests/kitemlistcontrollertest.cpp
443faa35ffae9d63bbe04dd876f0400982d29054
[dolphin.git] / src / tests / kitemlistcontrollertest.cpp
1 /***************************************************************************
2 * Copyright (C) 2012 by Frank Reininghaus <frank78ac@googlemail.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 #include <qtest_kde.h>
21 #include <qtestmouse.h>
22 #include <qtestkeyboard.h>
23
24 #include <KDirLister>
25 #include "kitemviews/kitemlistcontainer.h"
26 #include "kitemviews/kfileitemlistview.h"
27 #include "kitemviews/kfileitemmodel.h"
28 #include "kitemviews/kitemlistcontroller.h"
29 #include "kitemviews/kitemlistselectionmanager.h"
30 #include "kitemviews/kitemlistviewlayouter_p.h"
31 #include "testdir.h"
32
33 namespace {
34 const int DefaultTimeout = 2000;
35 };
36
37 Q_DECLARE_METATYPE(KFileItemListView::Layout);
38 Q_DECLARE_METATYPE(Qt::Orientation);
39 Q_DECLARE_METATYPE(KItemListController::SelectionBehavior);
40
41 class KItemListControllerTest : public QObject
42 {
43 Q_OBJECT
44
45 private slots:
46 void initTestCase();
47 void cleanupTestCase();
48
49 void init();
50 void cleanup();
51
52 void testKeyboardNavigation_data();
53 void testKeyboardNavigation();
54
55 private:
56 /**
57 * Make sure that the number of columns in the view is equal to \a count
58 * by changing the geometry of the container.
59 */
60 void adjustGeometryForColumnCount(int count);
61
62 private:
63 KFileItemListView* m_view;
64 KItemListController* m_controller;
65 KItemListSelectionManager* m_selectionManager;
66 KFileItemModel* m_model;
67 KDirLister* m_dirLister;
68 TestDir* m_testDir;
69 KItemListContainer* m_container;
70 };
71
72 /**
73 * This function initializes the member objects, creates the temporary files, and
74 * shows the view on the screen on startup. This could also be done before every
75 * single test, but this would make the time needed to run the test much larger.
76 */
77 void KItemListControllerTest::initTestCase()
78 {
79 m_testDir = new TestDir();
80 m_dirLister = new KDirLister();
81 m_model = new KFileItemModel(m_dirLister);
82 m_container = new KItemListContainer();
83 m_controller = m_container->controller();
84 m_controller->setSelectionBehavior(KItemListController::MultiSelection);
85 m_selectionManager = m_controller->selectionManager();
86
87 m_view = new KFileItemListView();
88 m_controller->setView(m_view);
89 m_controller->setModel(m_model);
90
91 QStringList files;
92 files
93 << "a1" << "a2" << "a3"
94 << "b1"
95 << "c1" << "c2" << "c3" << "c4" << "c5"
96 << "d1" << "d2" << "d3" << "d4"
97 << "e1" << "e2" << "e3" << "e4" << "e5" << "e6" << "e7";
98
99 m_testDir->createFiles(files);
100 m_dirLister->openUrl(m_testDir->url());
101 QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(loadingCompleted()), DefaultTimeout));
102
103 m_container->show();
104 QTest::qWaitForWindowShown(m_container);
105 }
106
107 void KItemListControllerTest::cleanupTestCase()
108 {
109 delete m_view;
110 m_view = 0;
111
112 delete m_container;
113 m_container = 0;
114 m_controller = 0;
115
116 delete m_model;
117 m_model = 0;
118
119 delete m_dirLister;
120 m_dirLister = 0;
121
122 delete m_testDir;
123 m_testDir = 0;
124 }
125
126 /** Before each test, the current item, selection, and item size are reset to the defaults. */
127 void KItemListControllerTest::init()
128 {
129 m_selectionManager->setCurrentItem(0);
130 QCOMPARE(m_selectionManager->currentItem(), 0);
131
132 m_selectionManager->clearSelection();
133 QVERIFY(!m_selectionManager->hasSelection());
134
135 const QSizeF itemSize(50, 50);
136 m_view->setItemSize(itemSize);
137 QCOMPARE(m_view->itemSize(), itemSize);
138 }
139
140 void KItemListControllerTest::cleanup()
141 {
142 }
143
144 /**
145 * \class KeyPress is a small helper struct that represents a key press event,
146 * including the key and the keyboard modifiers.
147 */
148 struct KeyPress {
149
150 KeyPress(Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier) :
151 m_key(key),
152 m_modifier(modifier)
153 {}
154
155 Qt::Key m_key;
156 Qt::KeyboardModifiers m_modifier;
157 };
158
159 /**
160 * \class ViewState is a small helper struct that represents a certain state
161 * of the view, including the current item and the selected items.
162 */
163 struct ViewState {
164
165 ViewState(int current, QSet<int> selection) :
166 m_current(current),
167 m_selection(selection)
168 {}
169
170 int m_current;
171 QSet<int> m_selection;
172 };
173
174 // We have to define a typedef for the pair in order to make the test compile.
175 typedef QPair<KeyPress, ViewState> keyPressViewStatePair;
176 Q_DECLARE_METATYPE(QList<keyPressViewStatePair>);
177
178 /**
179 * This function provides the data for the actual test function
180 * KItemListControllerTest::testKeyboardNavigation().
181 * It tests all possible combinations of view layouts, selection behaviors,
182 * and enabled/disabled groupings for different column counts, and
183 * provides a list of key presses and the states that the view should be in
184 * after the key press event.
185 */
186 void KItemListControllerTest::testKeyboardNavigation_data()
187 {
188 QTest::addColumn<KFileItemListView::Layout>("layout");
189 QTest::addColumn<Qt::Orientation>("scrollOrientation");
190 QTest::addColumn<int>("columnCount");
191 QTest::addColumn<KItemListController::SelectionBehavior>("selectionBehavior");
192 QTest::addColumn<bool>("groupingEnabled");
193 QTest::addColumn<QList<QPair<KeyPress, ViewState> > >("testList");
194
195 static QList<KFileItemListView::Layout> layoutList;
196 static QHash<KFileItemListView::Layout, QString> layoutNames;
197 if (layoutList.isEmpty()) {
198 layoutList.append(KFileItemListView::IconsLayout);
199 layoutNames[KFileItemListView::IconsLayout] = "Icons";
200
201 layoutList.append(KFileItemListView::CompactLayout);
202 layoutNames[KFileItemListView::CompactLayout] = "Compact";
203
204 layoutList.append(KFileItemListView::DetailsLayout);
205 layoutNames[KFileItemListView::DetailsLayout] = "Details";
206 }
207
208 static QList<KItemListController::SelectionBehavior> selectionBehaviorList;
209 static QHash<KItemListController::SelectionBehavior, QString> selectionBehaviorNames;
210 if (selectionBehaviorList.isEmpty()) {
211 selectionBehaviorList.append(KItemListController::NoSelection);
212 selectionBehaviorNames[KItemListController::NoSelection] = "NoSelection";
213
214 selectionBehaviorList.append(KItemListController::SingleSelection);
215 selectionBehaviorNames[KItemListController::SingleSelection] = "SingleSelection";
216
217 selectionBehaviorList.append(KItemListController::MultiSelection);
218 selectionBehaviorNames[KItemListController::MultiSelection] = "MultiSelection";
219 }
220
221 static QList<bool> groupingEnabledList;
222 static QHash<bool, QString> groupingEnabledNames;
223 if (groupingEnabledList.isEmpty()) {
224 groupingEnabledList.append(false);
225 groupingEnabledNames[false] = "ungrouped";
226
227 groupingEnabledList.append(true);
228 groupingEnabledNames[true] = "grouping enabled";
229 }
230
231 foreach (KFileItemListView::Layout layout, layoutList) {
232 // The following settings depend on the layout.
233 // Note that 'columns' are actually 'rows' in
234 // Compact layout.
235 Qt::Orientation scrollOrientation;
236 QList<int> columnCountList;
237 Qt::Key nextItemKey;
238 Qt::Key previousItemKey;
239 Qt::Key nextRowKey;
240 Qt::Key previousRowKey;
241
242 switch (layout) {
243 case KFileItemListView::IconsLayout:
244 scrollOrientation = Qt::Vertical;
245 columnCountList << 1 << 3 << 5;
246 nextItemKey = Qt::Key_Right;
247 previousItemKey = Qt::Key_Left;
248 nextRowKey = Qt::Key_Down;
249 previousRowKey = Qt::Key_Up;
250 break;
251 case KFileItemListView::CompactLayout:
252 scrollOrientation = Qt::Horizontal;
253 columnCountList << 1 << 3 << 5;
254 nextItemKey = Qt::Key_Down;
255 previousItemKey = Qt::Key_Up;
256 nextRowKey = Qt::Key_Right;
257 previousRowKey = Qt::Key_Left;
258 break;
259 case KFileItemListView::DetailsLayout:
260 scrollOrientation = Qt::Vertical;
261 columnCountList << 1;
262 nextItemKey = Qt::Key_Down;
263 previousItemKey = Qt::Key_Up;
264 nextRowKey = Qt::Key_Down;
265 previousRowKey = Qt::Key_Up;
266 break;
267 }
268
269 foreach (int columnCount, columnCountList) {
270 foreach (KItemListController::SelectionBehavior selectionBehavior, selectionBehaviorList) {
271 foreach (bool groupingEnabled, groupingEnabledList) {
272 QList<QPair<KeyPress, ViewState> > testList;
273
274 // First, key presses which should have the same effect
275 // for any layout and any number of columns.
276 testList
277 << qMakePair(KeyPress(nextItemKey), ViewState(1, QSet<int>() << 1))
278 << qMakePair(KeyPress(nextItemKey), ViewState(2, QSet<int>() << 2))
279 << qMakePair(KeyPress(nextItemKey, Qt::ShiftModifier), ViewState(3, QSet<int>() << 2 << 3))
280 << qMakePair(KeyPress(previousItemKey, Qt::ShiftModifier), ViewState(2, QSet<int>() << 2))
281 << qMakePair(KeyPress(nextItemKey, Qt::ShiftModifier), ViewState(3, QSet<int>() << 2 << 3))
282 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(4, QSet<int>() << 2 << 3))
283 << qMakePair(KeyPress(previousItemKey), ViewState(3, QSet<int>() << 3))
284 << qMakePair(KeyPress(Qt::Key_Home, Qt::ShiftModifier), ViewState(0, QSet<int>() << 0 << 1 << 2 << 3))
285 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(1, QSet<int>() << 0 << 1 << 2 << 3))
286 << qMakePair(KeyPress(Qt::Key_Space, Qt::ControlModifier), ViewState(1, QSet<int>() << 0 << 2 << 3))
287 << qMakePair(KeyPress(Qt::Key_Space, Qt::ControlModifier), ViewState(1, QSet<int>() << 0 << 1 << 2 << 3))
288 << qMakePair(KeyPress(Qt::Key_End), ViewState(19, QSet<int>() << 19))
289 << qMakePair(KeyPress(previousItemKey, Qt::ShiftModifier), ViewState(18, QSet<int>() << 18 << 19))
290 << qMakePair(KeyPress(Qt::Key_Home), ViewState(0, QSet<int>() << 0));
291
292 // Next, we test combinations of key presses which only work for a
293 // particular number of columns and either enabled or disabled grouping.
294
295 // One column.
296 if (columnCount == 1) {
297 testList
298 << qMakePair(KeyPress(nextRowKey), ViewState(1, QSet<int>() << 1))
299 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(2, QSet<int>() << 1 << 2))
300 << qMakePair(KeyPress(nextRowKey, Qt::ControlModifier), ViewState(3, QSet<int>() << 1 << 2))
301 << qMakePair(KeyPress(previousRowKey), ViewState(2, QSet<int>() << 2))
302 << qMakePair(KeyPress(previousItemKey), ViewState(1, QSet<int>() << 1))
303 << qMakePair(KeyPress(Qt::Key_Home), ViewState(0, QSet<int>() << 0));
304 }
305
306 // Multiple columns: we test both 3 and 5 columns with grouping
307 // enabled or disabled. For each case, the layout of the items
308 // in the view is shown (both using file names and indices) to
309 // make it easier to understand what the tests do.
310
311 if (columnCount == 3 && !groupingEnabled) {
312 // 3 columns, no grouping:
313 //
314 // a1 a2 a3 | 0 1 2
315 // b1 c1 c2 | 3 4 5
316 // c3 c4 c5 | 6 7 8
317 // d1 d2 d3 | 9 10 11
318 // d4 e1 e2 | 12 13 14
319 // e3 e4 e5 | 15 16 17
320 // e6 e7 | 18 19
321 testList
322 << qMakePair(KeyPress(nextRowKey), ViewState(3, QSet<int>() << 3))
323 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(4, QSet<int>() << 3))
324 << qMakePair(KeyPress(nextRowKey), ViewState(7, QSet<int>() << 7))
325 << qMakePair(KeyPress(nextItemKey, Qt::ShiftModifier), ViewState(8, QSet<int>() << 7 << 8))
326 << qMakePair(KeyPress(nextItemKey, Qt::ShiftModifier), ViewState(9, QSet<int>() << 7 << 8 << 9))
327 << qMakePair(KeyPress(previousItemKey, Qt::ShiftModifier), ViewState(8, QSet<int>() << 7 << 8))
328 << qMakePair(KeyPress(previousItemKey, Qt::ShiftModifier), ViewState(7, QSet<int>() << 7))
329 << qMakePair(KeyPress(previousItemKey, Qt::ShiftModifier), ViewState(6, QSet<int>() << 6 << 7))
330 << qMakePair(KeyPress(previousItemKey, Qt::ShiftModifier), ViewState(5, QSet<int>() << 5 << 6 << 7))
331 << qMakePair(KeyPress(nextItemKey, Qt::ShiftModifier), ViewState(6, QSet<int>() << 6 << 7))
332 << qMakePair(KeyPress(nextItemKey, Qt::ShiftModifier), ViewState(7, QSet<int>() << 7))
333 << qMakePair(KeyPress(nextRowKey), ViewState(10, QSet<int>() << 10))
334 << qMakePair(KeyPress(nextItemKey), ViewState(11, QSet<int>() << 11))
335 << qMakePair(KeyPress(nextRowKey), ViewState(14, QSet<int>() << 14))
336 << qMakePair(KeyPress(nextRowKey), ViewState(17, QSet<int>() << 17))
337 << qMakePair(KeyPress(nextRowKey), ViewState(19, QSet<int>() << 19))
338 << qMakePair(KeyPress(previousRowKey), ViewState(17, QSet<int>() << 17))
339 << qMakePair(KeyPress(Qt::Key_End), ViewState(19, QSet<int>() << 19))
340 << qMakePair(KeyPress(previousRowKey), ViewState(16, QSet<int>() << 16))
341 << qMakePair(KeyPress(Qt::Key_Home), ViewState(0, QSet<int>() << 0));
342 }
343
344 if (columnCount == 5 && !groupingEnabled) {
345 // 5 columns, no grouping:
346 //
347 // a1 a2 a3 b1 c1 | 0 1 2 3 4
348 // c2 c3 c4 c5 d1 | 5 6 7 8 9
349 // d2 d3 d4 e1 e2 | 10 11 12 13 14
350 // e3 e4 e5 e6 e7 | 15 16 17 18 19
351 testList
352 << qMakePair(KeyPress(nextRowKey), ViewState(5, QSet<int>() << 5))
353 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(6, QSet<int>() << 5))
354 << qMakePair(KeyPress(nextRowKey), ViewState(11, QSet<int>() << 11))
355 << qMakePair(KeyPress(nextItemKey), ViewState(12, QSet<int>() << 12))
356 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(17, QSet<int>() << 12 << 13 << 14 << 15 << 16 << 17))
357 << qMakePair(KeyPress(previousRowKey, Qt::ShiftModifier), ViewState(12, QSet<int>() << 12))
358 << qMakePair(KeyPress(previousRowKey, Qt::ShiftModifier), ViewState(7, QSet<int>() << 7 << 8 << 9 << 10 << 11 << 12))
359 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(12, QSet<int>() << 12))
360 << qMakePair(KeyPress(Qt::Key_End, Qt::ControlModifier), ViewState(19, QSet<int>() << 12))
361 << qMakePair(KeyPress(previousRowKey), ViewState(14, QSet<int>() << 14))
362 << qMakePair(KeyPress(Qt::Key_Home), ViewState(0, QSet<int>() << 0));
363 }
364
365 if (columnCount == 3 && groupingEnabled) {
366 // 3 columns, with grouping:
367 //
368 // a1 a2 a3 | 0 1 2
369 // b1 | 3
370 // c1 c2 c3 | 4 5 6
371 // c4 c5 | 7 8
372 // d1 d2 d3 | 9 10 11
373 // d4 | 12
374 // e1 e2 e3 | 13 14 15
375 // e4 e5 e6 | 16 17 18
376 // e7 | 19
377 testList
378 << qMakePair(KeyPress(nextItemKey), ViewState(1, QSet<int>() << 1))
379 << qMakePair(KeyPress(nextItemKey), ViewState(2, QSet<int>() << 2))
380 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(3, QSet<int>() << 2 << 3))
381 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(6, QSet<int>() << 2 << 3 << 4 << 5 << 6))
382 << qMakePair(KeyPress(nextRowKey), ViewState(8, QSet<int>() << 8))
383 << qMakePair(KeyPress(nextRowKey), ViewState(11, QSet<int>() << 11))
384 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(12, QSet<int>() << 11))
385 << qMakePair(KeyPress(nextRowKey), ViewState(13, QSet<int>() << 13))
386 << qMakePair(KeyPress(nextRowKey), ViewState(16, QSet<int>() << 16))
387 << qMakePair(KeyPress(nextItemKey), ViewState(17, QSet<int>() << 17))
388 << qMakePair(KeyPress(nextRowKey), ViewState(19, QSet<int>() << 19))
389 << qMakePair(KeyPress(previousRowKey), ViewState(17, QSet<int>() << 17))
390 << qMakePair(KeyPress(Qt::Key_Home), ViewState(0, QSet<int>() << 0));
391 }
392
393 if (columnCount == 5 && groupingEnabled) {
394 // 5 columns, with grouping:
395 //
396 // a1 a2 a3 | 0 1 2
397 // b1 | 3
398 // c1 c2 c3 c4 c5 | 4 5 6 7 8
399 // d1 d2 d3 d4 | 9 10 11 12
400 // e1 e2 e3 e4 e5 | 13 14 15 16 17
401 // e6 e7 | 18 19
402 testList
403 << qMakePair(KeyPress(nextItemKey), ViewState(1, QSet<int>() << 1))
404 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(3, QSet<int>() << 1 << 2 << 3))
405 << qMakePair(KeyPress(nextRowKey, Qt::ShiftModifier), ViewState(5, QSet<int>() << 1 << 2 << 3 << 4 << 5))
406 << qMakePair(KeyPress(nextItemKey), ViewState(6, QSet<int>() << 6))
407 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(7, QSet<int>() << 6))
408 << qMakePair(KeyPress(nextItemKey, Qt::ControlModifier), ViewState(8, QSet<int>() << 6))
409 << qMakePair(KeyPress(nextRowKey), ViewState(12, QSet<int>() << 12))
410 << qMakePair(KeyPress(nextRowKey), ViewState(17, QSet<int>() << 17))
411 << qMakePair(KeyPress(nextRowKey), ViewState(19, QSet<int>() << 19))
412 << qMakePair(KeyPress(previousRowKey), ViewState(17, QSet<int>() << 17))
413 << qMakePair(KeyPress(Qt::Key_End, Qt::ShiftModifier), ViewState(19, QSet<int>() << 17 << 18 << 19))
414 << qMakePair(KeyPress(previousRowKey, Qt::ShiftModifier), ViewState(14, QSet<int>() << 14 << 15 << 16 << 17))
415 << qMakePair(KeyPress(Qt::Key_Home), ViewState(0, QSet<int>() << 0));
416 }
417
418 const QString testName =
419 layoutNames[layout] + ", " +
420 QString("%1 columns, ").arg(columnCount) +
421 selectionBehaviorNames[selectionBehavior] + ", " +
422 groupingEnabledNames[groupingEnabled];
423
424 const QByteArray testNameAscii = testName.toAscii();
425
426 QTest::newRow(testNameAscii.data())
427 << layout
428 << scrollOrientation
429 << columnCount
430 << selectionBehavior
431 << groupingEnabled
432 << testList;
433 }
434 }
435 }
436 }
437 }
438
439 /**
440 * This function sets the view's properties according to the data provided by
441 * KItemListControllerTest::testKeyboardNavigation_data().
442 *
443 * The list \a testList contains pairs of key presses, which are sent to the
444 * container, and expected view states, which are verified then.
445 */
446 void KItemListControllerTest::testKeyboardNavigation()
447 {
448 QFETCH(KFileItemListView::Layout, layout);
449 QFETCH(Qt::Orientation, scrollOrientation);
450 QFETCH(int, columnCount);
451 QFETCH(KItemListController::SelectionBehavior, selectionBehavior);
452 QFETCH(bool, groupingEnabled);
453 QFETCH(QList<keyPressViewStatePair>, testList);
454
455 m_view->setItemLayout(layout);
456 QCOMPARE(m_view->itemLayout(), layout);
457
458 m_view->setScrollOrientation(scrollOrientation);
459 QCOMPARE(m_view->scrollOrientation(), scrollOrientation);
460
461 adjustGeometryForColumnCount(columnCount);
462 QCOMPARE(m_view->m_layouter->m_columnCount, columnCount);
463
464 m_controller->setSelectionBehavior(selectionBehavior);
465 QCOMPARE(m_controller->selectionBehavior(), selectionBehavior);
466
467 m_model->setGroupedSorting(groupingEnabled);
468 QCOMPARE(m_model->groupedSorting(), groupingEnabled);
469
470 while (!testList.isEmpty()) {
471 const QPair<KeyPress, ViewState> test = testList.takeFirst();
472 const Qt::Key key = test.first.m_key;
473 const Qt::KeyboardModifiers modifier = test.first.m_modifier;
474 const int current = test.second.m_current;
475 const QSet<int> selection = test.second.m_selection;
476
477 QTest::keyClick(m_container, key, modifier);
478 QCOMPARE(m_selectionManager->currentItem(), current);
479 switch (selectionBehavior) {
480 case KItemListController::NoSelection: QVERIFY(m_selectionManager->selectedItems().isEmpty()); break;
481 case KItemListController::SingleSelection: QCOMPARE(m_selectionManager->selectedItems(), QSet<int>() << current); break;
482 case KItemListController::MultiSelection: QCOMPARE(m_selectionManager->selectedItems(), selection); break;
483 }
484 }
485 }
486
487 void KItemListControllerTest::adjustGeometryForColumnCount(int count)
488 {
489 const QSize size = m_view->itemSize().toSize();
490
491 QRect rect = m_container->geometry();
492 rect.setSize(size * count);
493 m_container->setGeometry(rect);
494
495 // Increase the size of the container until the correct column count is reached.
496 while (m_view->m_layouter->m_columnCount < count) {
497 rect = m_container->geometry();
498 rect.setSize(rect.size() + size);
499 m_container->setGeometry(rect);
500 }
501 }
502
503 QTEST_KDEMAIN(KItemListControllerTest, GUI)
504
505 #include "kitemlistcontrollertest.moc"