From 49f08fa2fadb3ff1340af02be27045e92566dd58 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 15 Jun 2016 07:04:38 +0200 Subject: Fixed LocalStorageFacade. We can't make any assumptions about the lifetime of the facade, so make sure we have all we need in the lambda. --- tests/accountstest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp index 12e4685..5a63b31 100644 --- a/tests/accountstest.cpp +++ b/tests/accountstest.cpp @@ -101,20 +101,19 @@ private slots: Query query; query.liveQuery = true; auto model = Store::loadModel(query); - QSignalSpy spy(model.data(), &QAbstractItemModel::rowsInserted); - QTRY_COMPARE(spy.count(), 1); + QTRY_COMPARE(model->rowCount(QModelIndex()), 1); auto account2 = ApplicationDomainType::createEntity(); account2.setProperty("type", "maildir"); account2.setProperty("name", "name"); Store::create(account2).exec().waitForFinished(); - QTRY_COMPARE(spy.count(), 2); + QTRY_COMPARE(model->rowCount(QModelIndex()), 2); //Ensure the notifier only affects one type auto resource = ApplicationDomainType::createEntity(); resource.setProperty("type", "org.kde.mailtransport"); Store::create(resource).exec().waitForFinished(); - QTRY_COMPARE(spy.count(), 2); + QTRY_COMPARE(model->rowCount(QModelIndex()), 2); } }; -- cgit v1.2.3