Connection syntax migration (#637)
This commit is contained in:
@@ -75,7 +75,7 @@ TEST_F(CollectionBackendTest, EmptyDatabase) {
|
||||
|
||||
TEST_F(CollectionBackendTest, AddDirectory) {
|
||||
|
||||
QSignalSpy spy(backend_.get(), SIGNAL(DirectoryDiscovered(Directory, SubdirectoryList)));
|
||||
QSignalSpy spy(backend_.get(), &CollectionBackend::DirectoryDiscovered);
|
||||
|
||||
backend_->AddDirectory("/tmp");
|
||||
|
||||
@@ -96,7 +96,7 @@ TEST_F(CollectionBackendTest, RemoveDirectory) {
|
||||
dir.path = "/tmp";
|
||||
backend_->AddDirectory(dir.path);
|
||||
|
||||
QSignalSpy spy(backend_.get(), SIGNAL(DirectoryDeleted(Directory)));
|
||||
QSignalSpy spy(backend_.get(), &CollectionBackend::DirectoryDeleted);
|
||||
|
||||
// Remove the directory again
|
||||
backend_->RemoveDirectory(dir);
|
||||
@@ -117,7 +117,7 @@ TEST_F(CollectionBackendTest, AddInvalidSong) {
|
||||
//s.set_url(QUrl::fromLocalFile("foo.flac"));
|
||||
s.set_directory_id(1);
|
||||
|
||||
QSignalSpy spy(database_.get(), SIGNAL(Error(QString)));
|
||||
QSignalSpy spy(database_.get(), &Database::Error);
|
||||
|
||||
backend_->AddOrUpdateSongs(SongList() << s);
|
||||
//ASSERT_EQ(1, spy.count()); spy.takeFirst();
|
||||
@@ -161,8 +161,8 @@ class SingleSong : public CollectionBackendTest {
|
||||
}
|
||||
|
||||
void AddDummySong() {
|
||||
QSignalSpy added_spy(backend_.get(), SIGNAL(SongsDiscovered(SongList)));
|
||||
QSignalSpy deleted_spy(backend_.get(), SIGNAL(SongsDeleted(SongList)));
|
||||
QSignalSpy added_spy(backend_.get(), &CollectionBackend::SongsDiscovered);
|
||||
QSignalSpy deleted_spy(backend_.get(), &CollectionBackend::SongsDeleted);
|
||||
|
||||
// Add the song
|
||||
backend_->AddOrUpdateSongs(SongList() << song_);
|
||||
@@ -285,8 +285,8 @@ TEST_F(SingleSong, UpdateSong) {
|
||||
new_song.set_id(1);
|
||||
new_song.set_title("A different title");
|
||||
|
||||
QSignalSpy deleted_spy(backend_.get(), SIGNAL(SongsDeleted(SongList)));
|
||||
QSignalSpy added_spy(backend_.get(), SIGNAL(SongsDiscovered(SongList)));
|
||||
QSignalSpy deleted_spy(backend_.get(), &CollectionBackend::SongsDeleted);
|
||||
QSignalSpy added_spy(backend_.get(), &CollectionBackend::SongsDiscovered);
|
||||
|
||||
backend_->AddOrUpdateSongs(SongList() << new_song);
|
||||
|
||||
@@ -311,7 +311,7 @@ TEST_F(SingleSong, DeleteSongs) {
|
||||
Song new_song(song_);
|
||||
new_song.set_id(1);
|
||||
|
||||
QSignalSpy deleted_spy(backend_.get(), SIGNAL(SongsDeleted(SongList)));
|
||||
QSignalSpy deleted_spy(backend_.get(), &CollectionBackend::SongsDeleted);
|
||||
|
||||
backend_->DeleteSongs(SongList() << new_song);
|
||||
|
||||
@@ -343,7 +343,7 @@ TEST_F(SingleSong, MarkSongsUnavailable) {
|
||||
Song new_song(song_);
|
||||
new_song.set_id(1);
|
||||
|
||||
QSignalSpy deleted_spy(backend_.get(), SIGNAL(SongsDeleted(SongList)));
|
||||
QSignalSpy deleted_spy(backend_.get(), &CollectionBackend::SongsDeleted);
|
||||
|
||||
backend_->MarkSongsUnavailable(SongList() << new_song);
|
||||
|
||||
|
||||
@@ -253,9 +253,9 @@ TEST_F(CollectionModelTest, RemoveSongsLazyLoaded) {
|
||||
ASSERT_EQ(3, model_->rowCount(album_index));
|
||||
|
||||
// Remove the first two songs
|
||||
QSignalSpy spy_preremove(model_.get(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy spy_remove(model_.get(), SIGNAL(rowsRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy spy_reset(model_.get(), SIGNAL(modelReset()));
|
||||
QSignalSpy spy_preremove(model_.get(), &CollectionModel::rowsAboutToBeRemoved);
|
||||
QSignalSpy spy_remove(model_.get(), &CollectionModel::rowsRemoved);
|
||||
QSignalSpy spy_reset(model_.get(), &CollectionModel::modelReset);
|
||||
|
||||
backend_->DeleteSongs(SongList() << one << two);
|
||||
|
||||
@@ -278,9 +278,9 @@ TEST_F(CollectionModelTest, RemoveSongsNotLazyLoaded) {
|
||||
model_->Init(false);
|
||||
|
||||
// Remove the first two songs
|
||||
QSignalSpy spy_preremove(model_.get(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy spy_remove(model_.get(), SIGNAL(rowsRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy spy_reset(model_.get(), SIGNAL(modelReset()));
|
||||
QSignalSpy spy_preremove(model_.get(), &CollectionModel::rowsAboutToBeRemoved);
|
||||
QSignalSpy spy_remove(model_.get(), &CollectionModel::rowsRemoved);
|
||||
QSignalSpy spy_reset(model_.get(), &CollectionModel::modelReset);
|
||||
|
||||
backend_->DeleteSongs(SongList() << one << two);
|
||||
|
||||
@@ -576,9 +576,9 @@ TEST_F(CollectionModelTest, TestContainerNodes) {
|
||||
|
||||
model3->set_use_lazy_loading(false);
|
||||
|
||||
QSignalSpy model1_update(model1.get(), SIGNAL(rowsInserted(QModelIndex, int, int)));
|
||||
QSignalSpy model2_update(model2.get(), SIGNAL(rowsInserted(QModelIndex, int, int)));
|
||||
QSignalSpy model3_update(model3.get(), SIGNAL(rowsInserted(QModelIndex, int, int)));
|
||||
QSignalSpy model1_update(model1.get(), &CollectionModel::rowsInserted);
|
||||
QSignalSpy model2_update(model2.get(), &CollectionModel::rowsInserted);
|
||||
QSignalSpy model3_update(model3.get(), &CollectionModel::rowsInserted);
|
||||
|
||||
backend1->AddOrUpdateSongs(songs);
|
||||
backend2->AddOrUpdateSongs(songs);
|
||||
@@ -646,9 +646,9 @@ TEST_F(CollectionModelTest, TestContainerNodes) {
|
||||
}
|
||||
}
|
||||
|
||||
QSignalSpy database_reset_1(backend1.get(), SIGNAL(DatabaseReset()));
|
||||
QSignalSpy database_reset_2(backend2.get(), SIGNAL(DatabaseReset()));
|
||||
QSignalSpy database_reset_3(backend3.get(), SIGNAL(DatabaseReset()));
|
||||
QSignalSpy database_reset_1(backend1.get(), &CollectionBackend::DatabaseReset);
|
||||
QSignalSpy database_reset_2(backend2.get(), &CollectionBackend::DatabaseReset);
|
||||
QSignalSpy database_reset_3(backend3.get(), &CollectionBackend::DatabaseReset);
|
||||
|
||||
backend1->DeleteAll();
|
||||
backend2->DeleteAll();
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(ConcurrentRunTest, ConcurrentRun0StartAndWait) {
|
||||
QFutureWatcher<int> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(1337, watcher.result());
|
||||
|
||||
@@ -40,7 +40,7 @@ TEST(ConcurrentRunTest, ConcurrentRun1StartAndWait) {
|
||||
QFutureWatcher<int> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(1337, watcher.result());
|
||||
|
||||
@@ -60,7 +60,7 @@ TEST(ConcurrentRunTest, ConcurrentRun2StartAndWait) {
|
||||
QFutureWatcher<int> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(42, watcher.result());
|
||||
|
||||
@@ -81,7 +81,7 @@ TEST(ConcurrentRunTest, ConcurrentRun3StartAndWait) {
|
||||
QFutureWatcher<int> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(102, watcher.result());
|
||||
|
||||
@@ -113,7 +113,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidFunction1Start) {
|
||||
QFutureWatcher<void> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(1337, n);
|
||||
|
||||
@@ -128,7 +128,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidFunction2Start) {
|
||||
QFutureWatcher<void> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(1337, n);
|
||||
EXPECT_EQ(1338, m);
|
||||
@@ -144,7 +144,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidFunction3Start) {
|
||||
QFutureWatcher<void> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(1337, n);
|
||||
EXPECT_EQ(1338, m);
|
||||
@@ -169,7 +169,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidBindFunctionStart) {
|
||||
QFutureWatcher<void> watcher;
|
||||
watcher.setFuture(future);
|
||||
QEventLoop loop;
|
||||
QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&watcher, &QFutureWatcher<int>::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
EXPECT_EQ(11, nb);
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ TEST_F(MergedProxyModelTest, Merged) {
|
||||
|
||||
TEST_F(MergedProxyModelTest, SourceInsert) {
|
||||
|
||||
QSignalSpy before_spy(&merged_, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
|
||||
QSignalSpy after_spy(&merged_, SIGNAL(rowsInserted(QModelIndex,int,int)));
|
||||
QSignalSpy before_spy(&merged_, &MergedProxyModel::rowsAboutToBeInserted);
|
||||
QSignalSpy after_spy(&merged_, &MergedProxyModel::rowsInserted);
|
||||
|
||||
source_.appendRow(new QStandardItem("one"));
|
||||
|
||||
@@ -118,8 +118,8 @@ TEST_F(MergedProxyModelTest, SourceRemove) {
|
||||
|
||||
source_.appendRow(new QStandardItem("one"));
|
||||
|
||||
QSignalSpy before_spy(&merged_, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy after_spy(&merged_, SIGNAL(rowsRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy before_spy(&merged_, &MergedProxyModel::rowsAboutToBeRemoved);
|
||||
QSignalSpy after_spy(&merged_, &MergedProxyModel::rowsRemoved);
|
||||
|
||||
source_.removeRow(0, QModelIndex());
|
||||
|
||||
@@ -140,8 +140,8 @@ TEST_F(MergedProxyModelTest, SubInsert) {
|
||||
QStandardItemModel submodel;
|
||||
merged_.AddSubModel(source_.index(0, 0, QModelIndex()), &submodel);
|
||||
|
||||
QSignalSpy before_spy(&merged_, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
|
||||
QSignalSpy after_spy(&merged_, SIGNAL(rowsInserted(QModelIndex,int,int)));
|
||||
QSignalSpy before_spy(&merged_, &MergedProxyModel::rowsAboutToBeInserted);
|
||||
QSignalSpy after_spy(&merged_, &MergedProxyModel::rowsInserted);
|
||||
|
||||
submodel.appendRow(new QStandardItem("two"));
|
||||
|
||||
@@ -164,8 +164,8 @@ TEST_F(MergedProxyModelTest, SubRemove) {
|
||||
|
||||
submodel.appendRow(new QStandardItem("two"));
|
||||
|
||||
QSignalSpy before_spy(&merged_, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy after_spy(&merged_, SIGNAL(rowsRemoved(QModelIndex,int,int)));
|
||||
QSignalSpy before_spy(&merged_, &MergedProxyModel::rowsAboutToBeRemoved);
|
||||
QSignalSpy after_spy(&merged_, &MergedProxyModel::rowsRemoved);
|
||||
|
||||
submodel.removeRow(0, QModelIndex());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user