Commit be65c229 authored by David Faure's avatar David Faure
Browse files

Repair entitytreemodeltest which requires the itemsFetched private slot.

FakeAkonadiServerCommand::connectForwardingSignals() connects to it.

Not fully passing though, but much better than before...
FAIL!  : EntityTreeModelTest::testInitialFetch() Compared lists differ at index 0.
   Actual   (extractModelColumn(*m_model, parent, topLeft.row(), bottomRight.row())): QVariant(QString,Col 6)
   Expected (expectedSignal.newData): QVariant(QString,Col 2)
   Loc: [akonadi/autotests/libs/modelspy.cpp(84)]
FAIL!  : EntityTreeModelTest::testInitialFetch() Compared lists differ at index 0.
   Actual   (extractModelColumn(*m_model, parent, topLeft.row(), bottomRight.row())): QVariant(QString,Col 2)
   Expected (expectedSignal.newData): QVariant(QString,Col 7)
   Loc: [akonadi/autotests/libs/modelspy.cpp(84)]
FAIL!  : EntityTreeModelTest::testInitialFetch() Compared lists differ at index 0.
   Actual   (extractModelColumn(*m_model, parent, topLeft.row(), bottomRight.row())): QVariant(QString,Col 7)
   Expected (expectedSignal.newData): QVariant(QString,Col 6)
   Loc: [akonadi/autotests/libs/modelspy.cpp(84)]
Seems like an ordering problem...
parent b4d98e03
Pipeline #30651 passed with stage
in 40 minutes and 28 seconds
......@@ -680,6 +680,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void pasteJobDone(KJob *job))
Q_PRIVATE_SLOT(d_func(), void updateJobDone(KJob *job))
Q_PRIVATE_SLOT(d_func(), void itemsFetched(const Akonadi::Item::List &))
Q_PRIVATE_SLOT(d_func(), void collectionsFetched(Akonadi::Collection::List))
Q_PRIVATE_SLOT(d_func(), void topLevelCollectionsFetched(Akonadi::Collection::List))
Q_PRIVATE_SLOT(d_func(), void ancestorsFetched(Akonadi::Collection::List))
......
......@@ -200,6 +200,8 @@ void EntityTreeModelPrivate::agentInstanceRemoved(const Akonadi::AgentInstance &
}
}
static const char s_fetchCollectionId[] = "FetchCollectionId";
void EntityTreeModelPrivate::fetchItems(const Collection &parent)
{
Q_Q(const EntityTreeModel);
......@@ -212,6 +214,8 @@ void EntityTreeModelPrivate::fetchItems(const Collection &parent)
itemFetchJob->fetchScope().setIgnoreRetrievalErrors(true);
itemFetchJob->setDeliveryOption(ItemFetchJob::EmitItemsInBatches);
itemFetchJob->setProperty(s_fetchCollectionId, QVariant(parent.id()));
if (m_showRootCollection || parent != m_rootCollection) {
m_pendingCollectionRetrieveJobs.insert(parent.id());
......@@ -463,6 +467,14 @@ void EntityTreeModelPrivate::collectionsFetched(const Akonadi::Collection::List
}
}
// Used by entitytreemodeltest
void EntityTreeModelPrivate::itemsFetched(const Akonadi::Item::List &items)
{
Q_Q(EntityTreeModel);
const Collection::Id collectionId = q->sender()->property(s_fetchCollectionId).value<Collection::Id>();
itemsFetched(collectionId, items);
}
void EntityTreeModelPrivate::itemsFetched(const Collection::Id collectionId, const Akonadi::Item::List &items)
{
Q_Q(EntityTreeModel);
......
......@@ -155,6 +155,7 @@ public:
void fetchCollections(Akonadi::CollectionFetchJob *job);
void fetchItems(const Collection &collection);
void collectionsFetched(const Akonadi::Collection::List &collections);
void itemsFetched(const Akonadi::Item::List &items);
void itemsFetched(const Collection::Id collectionId, const Akonadi::Item::List &items);
void monitoredCollectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment