mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Port QSignalSpy to new signal syntax
More compile-time safety. Tests still pass. This also fixes a krazy warning about "normalised signal/slot signatures".
This commit is contained in:
parent
4709626a9b
commit
cef4d96cc6
|
@ -87,9 +87,9 @@ void KFileItemListViewTest::cleanup()
|
|||
*/
|
||||
void KFileItemListViewTest::testGroupedItemChanges()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QVERIFY(itemsInsertedSpy.isValid());
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
QVERIFY(itemsRemovedSpy.isValid());
|
||||
|
||||
m_model->setGroupedSorting(true);
|
||||
|
|
|
@ -167,8 +167,8 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems()
|
|||
model.m_naturalSorting = false;
|
||||
model.setRoles({"text"});
|
||||
|
||||
QSignalSpy spyItemsInserted(&model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy spyItemsRemoved(&model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy spyItemsInserted(&model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy spyItemsRemoved(&model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
QBENCHMARK {
|
||||
model.slotClear();
|
||||
|
|
|
@ -144,7 +144,7 @@ void KFileItemModelTest::testDefaultRoles()
|
|||
|
||||
void KFileItemModelTest::testDefaultSortRole()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QVERIFY(itemsInsertedSpy.isValid());
|
||||
|
||||
QCOMPARE(m_model->sortRole(), QByteArray("text"));
|
||||
|
@ -167,7 +167,7 @@ void KFileItemModelTest::testDefaultGroupedSorting()
|
|||
|
||||
void KFileItemModelTest::testNewItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
m_testDir->createFiles({"a.txt", "b.txt", "c.txt"});
|
||||
|
||||
|
@ -181,8 +181,8 @@ void KFileItemModelTest::testNewItems()
|
|||
|
||||
void KFileItemModelTest::testRemoveItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
m_testDir->createFiles({"a.txt", "b.txt"});
|
||||
m_model->loadDirectory(m_testDir->url());
|
||||
|
@ -199,9 +199,9 @@ void KFileItemModelTest::testRemoveItems()
|
|||
|
||||
void KFileItemModelTest::testDirLoadingCompleted()
|
||||
{
|
||||
QSignalSpy loadingCompletedSpy(m_model, SIGNAL(directoryLoadingCompleted()));
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy loadingCompletedSpy(m_model, &KFileItemModel::directoryLoadingCompleted);
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
m_testDir->createFiles({"a.txt", "b.txt", "c.txt"});
|
||||
|
||||
|
@ -242,9 +242,9 @@ void KFileItemModelTest::testDirLoadingCompleted()
|
|||
|
||||
void KFileItemModelTest::testSetData()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QVERIFY(itemsInsertedSpy.isValid());
|
||||
QSignalSpy itemsChangedSpy(m_model, SIGNAL(itemsChanged(KItemRangeList, QSet<QByteArray>)));
|
||||
QSignalSpy itemsChangedSpy(m_model, &KFileItemModel::itemsChanged);
|
||||
QVERIFY(itemsChangedSpy.isValid());
|
||||
|
||||
m_testDir->createFile("a.txt");
|
||||
|
@ -297,9 +297,9 @@ void KFileItemModelTest::testSetDataWithModifiedSortRole()
|
|||
QFETCH(int, ratingIndex1);
|
||||
QFETCH(int, ratingIndex2);
|
||||
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QVERIFY(itemsInsertedSpy.isValid());
|
||||
QSignalSpy itemsMovedSpy(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)));
|
||||
QSignalSpy itemsMovedSpy(m_model, &KFileItemModel::itemsMoved);
|
||||
QVERIFY(itemsMovedSpy.isValid());
|
||||
|
||||
// Changing the value of a sort-role must result in
|
||||
|
@ -352,8 +352,8 @@ void KFileItemModelTest::testSetDataWithModifiedSortRole()
|
|||
|
||||
void KFileItemModelTest::testChangeSortRole()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsMovedSpy(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsMovedSpy(m_model, &KFileItemModel::itemsMoved);
|
||||
QVERIFY(itemsMovedSpy.isValid());
|
||||
|
||||
QCOMPARE(m_model->sortRole(), QByteArray("text"));
|
||||
|
@ -392,8 +392,8 @@ void KFileItemModelTest::testChangeSortRole()
|
|||
|
||||
void KFileItemModelTest::testResortAfterChangingName()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsMovedSpy(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsMovedSpy(m_model, &KFileItemModel::itemsMoved);
|
||||
QVERIFY(itemsMovedSpy.isValid());
|
||||
|
||||
// We sort by size in a directory where all files have the same size.
|
||||
|
@ -430,7 +430,7 @@ void KFileItemModelTest::testResortAfterChangingName()
|
|||
|
||||
void KFileItemModelTest::testModelConsistencyWhenInsertingItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
// KFileItemModel prevents that inserting a punch of items sequentially
|
||||
// results in an itemsInserted()-signal for each item. Instead internally
|
||||
|
@ -472,7 +472,7 @@ void KFileItemModelTest::testModelConsistencyWhenInsertingItems()
|
|||
|
||||
void KFileItemModelTest::testItemRangeConsistencyWhenInsertingItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
m_testDir->createFiles({"B", "E", "G"});
|
||||
|
||||
|
@ -511,11 +511,11 @@ void KFileItemModelTest::testItemRangeConsistencyWhenInsertingItems()
|
|||
|
||||
void KFileItemModelTest::testExpandItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QVERIFY(itemsInsertedSpy.isValid());
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
QVERIFY(itemsRemovedSpy.isValid());
|
||||
QSignalSpy loadingCompletedSpy(m_model, SIGNAL(directoryLoadingCompleted()));
|
||||
QSignalSpy loadingCompletedSpy(m_model, &KFileItemModel::directoryLoadingCompleted);
|
||||
QVERIFY(loadingCompletedSpy.isValid());
|
||||
|
||||
// Test expanding subfolders in a folder with the items "a/", "a/a/", "a/a/1", "a/a-1/", "a/a-1/1".
|
||||
|
@ -648,8 +648,8 @@ void KFileItemModelTest::testExpandItems()
|
|||
|
||||
void KFileItemModelTest::testExpandParentItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy loadingCompletedSpy(m_model, SIGNAL(directoryLoadingCompleted()));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy loadingCompletedSpy(m_model, &KFileItemModel::directoryLoadingCompleted);
|
||||
QVERIFY(loadingCompletedSpy.isValid());
|
||||
|
||||
// Create a tree structure of folders:
|
||||
|
@ -729,8 +729,8 @@ void KFileItemModelTest::testExpandParentItems()
|
|||
*/
|
||||
void KFileItemModelTest::testMakeExpandedItemHidden()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -772,7 +772,7 @@ void KFileItemModelTest::testMakeExpandedItemHidden()
|
|||
|
||||
void KFileItemModelTest::testRemoveFilteredExpandedItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
QSet<QByteArray> originalModelRoles = m_model->roles();
|
||||
QSet<QByteArray> modelRoles = originalModelRoles;
|
||||
|
@ -817,8 +817,8 @@ void KFileItemModelTest::testRemoveFilteredExpandedItems()
|
|||
|
||||
void KFileItemModelTest::testSorting()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsMovedSpy(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsMovedSpy(m_model, &KFileItemModel::itemsMoved);
|
||||
QVERIFY(itemsMovedSpy.isValid());
|
||||
|
||||
// Create some files with different sizes and modification times to check the different sorting options
|
||||
|
@ -952,7 +952,7 @@ void KFileItemModelTest::testSorting()
|
|||
|
||||
void KFileItemModelTest::testIndexForKeyboardSearch()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
m_testDir->createFiles({"a", "aa", "Image.jpg", "Image.png", "Text", "Text1", "Text2", "Text11"});
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ void KFileItemModelTest::testIndexForKeyboardSearch()
|
|||
|
||||
void KFileItemModelTest::testNameFilter()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
m_testDir->createFiles({"A1", "A2", "Abc", "Bcd", "Cde"});
|
||||
|
||||
|
@ -1059,8 +1059,8 @@ void KFileItemModelTest::testEmptyPath()
|
|||
*/
|
||||
void KFileItemModelTest::testRefreshExpandedItem()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsChangedSpy(m_model, SIGNAL(itemsChanged(KItemRangeList, QSet<QByteArray>)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsChangedSpy(m_model, &KFileItemModel::itemsChanged);
|
||||
QVERIFY(itemsChangedSpy.isValid());
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
|
@ -1098,8 +1098,8 @@ void KFileItemModelTest::testRemoveHiddenItems()
|
|||
m_testDir->createDir("d");
|
||||
m_testDir->createFiles({".f", ".g", "h", "i"});
|
||||
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
m_model->setShowHiddenFiles(true);
|
||||
m_model->loadDirectory(m_testDir->url());
|
||||
|
@ -1141,8 +1141,8 @@ void KFileItemModelTest::testRemoveHiddenItems()
|
|||
*/
|
||||
void KFileItemModelTest::collapseParentOfHiddenItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1191,8 +1191,8 @@ void KFileItemModelTest::collapseParentOfHiddenItems()
|
|||
*/
|
||||
void KFileItemModelTest::removeParentOfHiddenItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1244,8 +1244,8 @@ void KFileItemModelTest::removeParentOfHiddenItems()
|
|||
*/
|
||||
void KFileItemModelTest::testGeneralParentChildRelationships()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsRemovedSpy(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsRemovedSpy(m_model, &KFileItemModel::itemsRemoved);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1331,10 +1331,10 @@ void KFileItemModelTest::testGeneralParentChildRelationships()
|
|||
|
||||
void KFileItemModelTest::testNameRoleGroups()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsMovedSpy(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
QSignalSpy itemsMovedSpy(m_model, &KFileItemModel::itemsMoved);
|
||||
QVERIFY(itemsMovedSpy.isValid());
|
||||
QSignalSpy groupsChangedSpy(m_model, SIGNAL(groupsChanged()));
|
||||
QSignalSpy groupsChangedSpy(m_model, &KFileItemModel::groupsChanged);
|
||||
QVERIFY(groupsChangedSpy.isValid());
|
||||
|
||||
m_testDir->createFiles({"b.txt", "c.txt", "d.txt", "e.txt"});
|
||||
|
@ -1399,7 +1399,7 @@ void KFileItemModelTest::testNameRoleGroups()
|
|||
|
||||
void KFileItemModelTest::testNameRoleGroupsWithExpandedItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1437,7 +1437,7 @@ void KFileItemModelTest::testNameRoleGroupsWithExpandedItems()
|
|||
|
||||
void KFileItemModelTest::testInconsistentModel()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1493,7 +1493,7 @@ void KFileItemModelTest::testInconsistentModel()
|
|||
|
||||
void KFileItemModelTest::testChangeRolesForFilteredItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "owner";
|
||||
|
@ -1590,7 +1590,7 @@ void KFileItemModelTest::testChangeSortRoleWhileFiltering()
|
|||
|
||||
void KFileItemModelTest::testRefreshFilteredItems()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
m_testDir->createFiles({"a.txt", "b.txt", "c.jpg", "d.jpg"});
|
||||
|
||||
|
@ -1619,7 +1619,7 @@ void KFileItemModelTest::testRefreshFilteredItems()
|
|||
|
||||
void KFileItemModelTest::testCreateMimeData()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1646,7 +1646,7 @@ void KFileItemModelTest::testCreateMimeData()
|
|||
|
||||
void KFileItemModelTest::testCollapseFolderWhileLoading()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
QSet<QByteArray> modelRoles = m_model->roles();
|
||||
modelRoles << "isExpanded" << "isExpandable" << "expandedParentsCount";
|
||||
|
@ -1724,7 +1724,7 @@ void KFileItemModelTest::testCollapseFolderWhileLoading()
|
|||
|
||||
void KFileItemModelTest::testDeleteFileMoreThanOnce()
|
||||
{
|
||||
QSignalSpy itemsInsertedSpy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QSignalSpy itemsInsertedSpy(m_model, &KFileItemModel::itemsInserted);
|
||||
|
||||
m_testDir->createFiles({"a.txt", "b.txt", "c.txt", "d.txt"});
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ void KItemListControllerTest::initTestCase()
|
|||
|
||||
m_testDir->createFiles(files);
|
||||
m_model->loadDirectory(m_testDir->url());
|
||||
QSignalSpy spyDirectoryLoadingCompleted(m_model, SIGNAL(directoryLoadingCompleted()));
|
||||
QSignalSpy spyDirectoryLoadingCompleted(m_model, &KFileItemModel::directoryLoadingCompleted);
|
||||
QVERIFY(spyDirectoryLoadingCompleted.wait());
|
||||
|
||||
m_container->show();
|
||||
|
@ -507,8 +507,8 @@ void KItemListControllerTest::testKeyboardNavigation()
|
|||
adjustGeometryForColumnCount(columnCount);
|
||||
QCOMPARE(m_view->m_layouter->m_columnCount, columnCount);
|
||||
|
||||
QSignalSpy spySingleItemActivated(m_controller, SIGNAL(itemActivated(int)));
|
||||
QSignalSpy spyMultipleItemsActivated(m_controller, SIGNAL(itemsActivated(KItemSet)));
|
||||
QSignalSpy spySingleItemActivated(m_controller, &KItemListController::itemActivated);
|
||||
QSignalSpy spyMultipleItemsActivated(m_controller, &KItemListController::itemsActivated);
|
||||
|
||||
while (!testList.isEmpty()) {
|
||||
const QPair<KeyPress, ViewState> test = testList.takeFirst();
|
||||
|
@ -584,7 +584,7 @@ void KItemListControllerTest::testMouseClickActivation()
|
|||
mouseReleaseEvent.setButton(Qt::LeftButton);
|
||||
mouseReleaseEvent.setButtons(Qt::NoButton);
|
||||
|
||||
QSignalSpy spyItemActivated(m_controller, SIGNAL(itemActivated(int)));
|
||||
QSignalSpy spyItemActivated(m_controller, &KItemListController::itemActivated);
|
||||
|
||||
// Default setting: single click activation.
|
||||
m_testStyle->setActivateItemOnSingleClick(true);
|
||||
|
|
|
@ -46,7 +46,7 @@ void KItemListKeyboardSearchManagerTest::init()
|
|||
|
||||
void KItemListKeyboardSearchManagerTest::testBasicKeyboardSearch()
|
||||
{
|
||||
QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
|
||||
QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
|
||||
QVERIFY(spy.isValid());
|
||||
|
||||
m_keyboardSearchManager.addKeys("f");
|
||||
|
@ -72,7 +72,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch()
|
|||
// to save time when running this test.
|
||||
m_keyboardSearchManager.setTimeout(100);
|
||||
|
||||
QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
|
||||
QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
|
||||
QVERIFY(spy.isValid());
|
||||
|
||||
m_keyboardSearchManager.addKeys("f");
|
||||
|
@ -104,7 +104,7 @@ void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress()
|
|||
// 1. the string contains the repeated key only once, and
|
||||
// 2. the bool searchFromNextItem is true.
|
||||
|
||||
QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
|
||||
QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
|
||||
QVERIFY(spy.isValid());
|
||||
|
||||
m_keyboardSearchManager.addKeys("p");
|
||||
|
@ -132,7 +132,7 @@ void KItemListKeyboardSearchManagerTest::testPressShift()
|
|||
// string. Make sure that this does not reset the current search. See
|
||||
// https://bugs.kde.org/show_bug.cgi?id=321286
|
||||
|
||||
QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
|
||||
QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
|
||||
QVERIFY(spy.isValid());
|
||||
|
||||
// Simulate that the user enters "a_b".
|
||||
|
|
|
@ -115,7 +115,7 @@ void KItemListSelectionManagerTest::testConstructor()
|
|||
|
||||
void KItemListSelectionManagerTest::testCurrentItemAnchorItem()
|
||||
{
|
||||
QSignalSpy spyCurrent(m_selectionManager, SIGNAL(currentChanged(int,int)));
|
||||
QSignalSpy spyCurrent(m_selectionManager, &KItemListSelectionManager::currentChanged);
|
||||
|
||||
// Set current item and check that the selection manager emits the currentChanged(int,int) signal correctly.
|
||||
m_selectionManager->setCurrentItem(4);
|
||||
|
@ -445,7 +445,7 @@ void KItemListSelectionManagerTest::testChangeSelection()
|
|||
QFETCH(QList<QVariant>, data);
|
||||
QFETCH(KItemSet, finalSelection);
|
||||
|
||||
QSignalSpy spySelectionChanged(m_selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)));
|
||||
QSignalSpy spySelectionChanged(m_selectionManager, &KItemListSelectionManager::selectionChanged);
|
||||
|
||||
// Initial selection should be empty
|
||||
QVERIFY(!m_selectionManager->hasSelection());
|
||||
|
|
Loading…
Reference in a new issue