From 303a3cf5ba48dd9857a1fb9600cedd604c71de8d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 6 Dec 2015 19:01:03 +0100 Subject: Added TypeIndex A central location for all types to specify what properties are indexed, and how to query them. --- tests/querytest.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/querytest.cpp') diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 669bf58..516af35 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp @@ -154,6 +154,31 @@ private Q_SLOTS: QTRY_COMPARE(model->rowCount(), 1); model->fetchMore(model->index(0, 0)); QTRY_COMPARE(model->rowCount(model->index(0, 0)), 1); + void testMailByUid() + { + //Setup + { + Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + mail.setProperty("uid", "test1"); + mail.setProperty("sender", "doe@example.org"); + Akonadi2::Store::create(mail).exec().waitForFinished(); + } + + //Test + Akonadi2::Query query; + query.resources << "org.kde.dummy.instance1"; + query.syncOnDemand = false; + query.processAll = true; + query.liveQuery = false; + query.propertyFilter.insert("uid", "test1"); + + //Ensure all local data is processed + Akonadi2::Store::synchronize(query).exec().waitForFinished(); + + //We fetch before the data is available and rely on the live query mechanism to deliver the actual data + auto model = Akonadi2::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QCOMPARE(model->rowCount(), 1); } }; -- cgit v1.2.3