X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a06ee3399bece608790e419054f95807a017a020..464b13f3828e5cdd03438d0881c3a62c7cda6333:/src/tests/kitemlistselectionmanagertest.cpp diff --git a/src/tests/kitemlistselectionmanagertest.cpp b/src/tests/kitemlistselectionmanagertest.cpp index 8403de701..245f23d64 100644 --- a/src/tests/kitemlistselectionmanagertest.cpp +++ b/src/tests/kitemlistselectionmanagertest.cpp @@ -26,11 +26,12 @@ class DummyModel : public KItemModelBase { + Q_OBJECT public: DummyModel(); void setCount(int count); - virtual int count() const; - virtual QHash data(int index) const; + int count() const override; + QHash data(int index) const override; private: int m_count; @@ -322,39 +323,38 @@ namespace { }; } -Q_DECLARE_METATYPE(KItemSet); -Q_DECLARE_METATYPE(ChangeType); -Q_DECLARE_METATYPE(KItemRange); -Q_DECLARE_METATYPE(KItemRangeList); -Q_DECLARE_METATYPE(KItemListSelectionManager::SelectionMode); -Q_DECLARE_METATYPE(QList); +Q_DECLARE_METATYPE(KItemSet) +Q_DECLARE_METATYPE(ChangeType) +Q_DECLARE_METATYPE(KItemRange) +Q_DECLARE_METATYPE(KItemRangeList) +Q_DECLARE_METATYPE(KItemListSelectionManager::SelectionMode) +Q_DECLARE_METATYPE(QList) /** * The following function provides a generic way to test the selection functionality. * * The test is data-driven and takes the following arguments: * - * \param initialSelection The selection at the beginning. - * \param anchor This item will be the anchor item. - * \param current This item will be the current item. - * \param expectedSelection Expected selection after anchor and current are set. - * \param changeType Type of the change that is done then: - * - NoChange - * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted() - * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved() - * - MoveItems -> data.at(0) provides the KItemRange containing the original indices, - * data.at(1) provides the list containing the new indices - * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved() - * - EndAnchoredSelection - * - SetSelected -> data.at(0) provides the index where the selection process starts, - * data.at(1) provides the number of indices to be selected, - * data.at(2) provides the selection mode. - * \sa KItemListSelectionManager::setSelected() - * \param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above). - * \param finalSelection The expected final selection. + * param initialSelection The selection at the beginning. + * param anchor This item will be the anchor item. + * param current This item will be the current item. + * param expectedSelection Expected selection after anchor and current are set. + * param changeType Type of the change that is done then: + * - NoChange + * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted() + * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved() + * - MoveItems -> data.at(0) provides the KItemRange containing the original indices, + * data.at(1) provides the list containing the new indices + * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved() + * - EndAnchoredSelection + * - SetSelected -> data.at(0) provides the index where the selection process starts, + * data.at(1) provides the number of indices to be selected, + * data.at(2) provides the selection mode. + * \sa KItemListSelectionManager::setSelected() + * param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above). + * param finalSelection The expected final selection. * */ - void KItemListSelectionManagerTest::testChangeSelection_data() { QTest::addColumn("initialSelection"); @@ -572,6 +572,6 @@ void KItemListSelectionManagerTest::verifySelectionChange(QSignalSpy& spy, } } -QTEST_MAIN(KItemListSelectionManagerTest) +QTEST_GUILESS_MAIN(KItemListSelectionManagerTest) #include "kitemlistselectionmanagertest.moc"