X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b1e69cae00a708aa50dbd03eca944e83a639d861..519c2d435fe17bbaea4e0219ab570473bd567b11:/src/tests/testbase.cpp diff --git a/src/tests/testbase.cpp b/src/tests/testbase.cpp index 5945cd258..db71fa48c 100644 --- a/src/tests/testbase.cpp +++ b/src/tests/testbase.cpp @@ -19,6 +19,8 @@ #include "testbase.h" +#include + #include "views/dolphinview.h" #include "views/dolphinmodel.h" #include "views/dolphindirlister.h" @@ -29,28 +31,20 @@ #include #include +#include + TestBase::TestBase() { m_tempDir = new KTempDir; Q_ASSERT(m_tempDir->exists()); m_path = m_tempDir->name(); m_dir = new QDir(m_path); - m_dirLister = new DolphinDirLister(); - m_dirLister->setAutoUpdate(true); - m_dolphinModel = new DolphinModel(); - m_dolphinModel->setDirLister(m_dirLister); - m_proxyModel = new DolphinSortFilterProxyModel(0); - m_proxyModel->setSourceModel(m_dolphinModel); - m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); - m_view = new DolphinView(0, KUrl(m_path), m_proxyModel); + m_view = new DolphinView(KUrl(m_path), 0); } TestBase::~TestBase() { delete m_view; - delete m_proxyModel; - // m_dolphinModel owns m_dirLister -> do not delete it here! - delete m_dolphinModel; delete m_dir; delete m_tempDir; } @@ -60,6 +54,11 @@ QAbstractItemView* TestBase::itemView () const return m_view->m_viewAccessor.itemView(); } +void TestBase::reloadViewAndWait() +{ + m_view->reload(); + QVERIFY(QTest::kWaitForSignal(m_view, SIGNAL(finishedPathLoading(const KUrl&)), 2000)); +} KUrl TestBase::testDirUrl() const {