]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/kitemlistkeyboardsearchmanagertest.cpp
Fix compilation with Qt 5.2 and 5.3; QSignalSpy can't take a function pointer yet
[dolphin.git] / src / tests / kitemlistkeyboardsearchmanagertest.cpp
index 41475660de7f8d8dbb3412bbd7558f46c0a7f9a8..6720b9fc3ce0daa3ca6fb929f527aa70a6f949cf 100644 (file)
@@ -46,7 +46,8 @@ void KItemListKeyboardSearchManagerTest::init()
 
 void KItemListKeyboardSearchManagerTest::testBasicKeyboardSearch()
 {
-    QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
+    QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
+    QVERIFY(spy.isValid());
 
     m_keyboardSearchManager.addKeys("f");
     QCOMPARE(spy.count(), 1);
@@ -71,7 +72,8 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch()
     // to save time when running this test.
     m_keyboardSearchManager.setTimeout(100);
 
-    QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
+    QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
+    QVERIFY(spy.isValid());
 
     m_keyboardSearchManager.addKeys("f");
     QCOMPARE(spy.count(), 1);
@@ -102,7 +104,8 @@ void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress()
     // 1. the string contains the repeated key only once, and
     // 2. the bool searchFromNextItem is true.
 
-    QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem);
+    QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
+    QVERIFY(spy.isValid());
 
     m_keyboardSearchManager.addKeys("p");
     QCOMPARE(spy.count(), 1);
@@ -129,7 +132,8 @@ 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, &KItemListKeyboardSearchManager::changeCurrentItem);
+    QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString, bool)));
+    QVERIFY(spy.isValid());
 
     // Simulate that the user enters "a_b".
     m_keyboardSearchManager.addKeys("a");