X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/40c71d5ce0f6978ce48eb67fd73ed211bab4e887..727fd64e121f97b32d645e2fb26c4e93c413a849:/src/tests/kitemlistcontrollertest.cpp diff --git a/src/tests/kitemlistcontrollertest.cpp b/src/tests/kitemlistcontrollertest.cpp index 3b67e7b50..47b2b8b75 100644 --- a/src/tests/kitemlistcontrollertest.cpp +++ b/src/tests/kitemlistcontrollertest.cpp @@ -33,7 +33,7 @@ namespace { const int DefaultTimeout = 2000; }; -Q_DECLARE_METATYPE(KFileItemListView::Layout); +Q_DECLARE_METATYPE(KFileItemListView::ItemLayout); Q_DECLARE_METATYPE(Qt::Orientation); Q_DECLARE_METATYPE(KItemListController::SelectionBehavior); Q_DECLARE_METATYPE(QSet); @@ -79,15 +79,13 @@ void KItemListControllerTest::initTestCase() m_testDir = new TestDir(); m_model = new KFileItemModel(); - m_container = new KItemListContainer(); + m_view = new KFileItemListView(); + m_controller = new KItemListController(m_model, m_view, this); + m_container = new KItemListContainer(m_controller); m_controller = m_container->controller(); m_controller->setSelectionBehavior(KItemListController::MultiSelection); m_selectionManager = m_controller->selectionManager(); - m_view = new KFileItemListView(); - m_controller->setView(m_view); - m_controller->setModel(m_model); - QStringList files; files << "a1" << "a2" << "a3" @@ -106,15 +104,8 @@ void KItemListControllerTest::initTestCase() void KItemListControllerTest::cleanupTestCase() { - delete m_view; - m_view = 0; - delete m_container; m_container = 0; - m_controller = 0; - - delete m_model; - m_model = 0; delete m_testDir; m_testDir = 0; @@ -187,15 +178,15 @@ Q_DECLARE_METATYPE(QList); */ void KItemListControllerTest::testKeyboardNavigation_data() { - QTest::addColumn("layout"); + QTest::addColumn("layout"); QTest::addColumn("scrollOrientation"); QTest::addColumn("columnCount"); QTest::addColumn("selectionBehavior"); QTest::addColumn("groupingEnabled"); QTest::addColumn > >("testList"); - QList layoutList; - QHash layoutNames; + QList layoutList; + QHash layoutNames; layoutList.append(KFileItemListView::IconsLayout); layoutNames[KFileItemListView::IconsLayout] = "Icons"; layoutList.append(KFileItemListView::CompactLayout); @@ -219,7 +210,7 @@ void KItemListControllerTest::testKeyboardNavigation_data() groupingEnabledList.append(true); groupingEnabledNames[true] = "grouping enabled"; - foreach (KFileItemListView::Layout layout, layoutList) { + foreach (KFileItemListView::ItemLayout layout, layoutList) { // The following settings depend on the layout. // Note that 'columns' are actually 'rows' in // Compact layout. @@ -443,7 +434,7 @@ void KItemListControllerTest::testKeyboardNavigation_data() */ void KItemListControllerTest::testKeyboardNavigation() { - QFETCH(KFileItemListView::Layout, layout); + QFETCH(KFileItemListView::ItemLayout, layout); QFETCH(Qt::Orientation, scrollOrientation); QFETCH(int, columnCount); QFETCH(KItemListController::SelectionBehavior, selectionBehavior);