EntityTreeModelPrivate::monitoredItemChanged

Daniel Vrátil dvratil at kde.org
Sat Apr 22 22:49:49 BST 2017


On Saturday, April 22, 2017 6:47:54 PM CEST Martin Koller wrote:
> On Samstag, 22. April 2017 14:33:25 CEST Daniel Vrátil wrote:
> > On Saturday, April 22, 2017 2:02:11 PM CEST Martin Koller wrote:
> > > On Samstag, 22. April 2017 13:00:21 CEST Daniel Vrátil wrote:
> > > > On Saturday, April 22, 2017 9:27:48 AM CEST Martin Koller wrote:
> > > I found out now that (in case of the akonadi_mailfilter_agent) the ETM
> > > receives the item, but in monitoredItemAdded() it is not inserted into
> > > the
> > > QHash since the function returns at
> > > 
> > >     //Adding items to not yet populated collections would block
> > >     fetchMore,
> > > 
> > > resulting in only new items showing up in the collection //This is only
> > > a
> > > problem with lazy population, otherwise fetchMore is not used at all if
> > > ((m_itemPopulation == EntityTreeModel::LazyPopulation) &&
> > > !m_populatedCols.contains(collection.id())) { return;
> > > 
> > >     }
> > > 
> > > hmmm ... does this ring a bell ?
> > 
> > Nice find! And monitoredItemChanged() does not take the lazy population in
> > account, thus printing the warning. So the fix would be to simply add the
> > same lazy population check to monitoredItemChanged() and simply ignore
> > the change
> ok, patch attached.

Please upload patches to phabricator.kde.org - it's easier to review and 
discuss the code there.

> Still 2 questions:
> - I assume this has to be checked also in the other methods, e.g.
> monitoredItemUnlinked, monitoredItemRemoved ? - some of these methods do
> not have the collection as argument. Can I assume that in these cases the
> parentCollection() is always valid ?

Right, the other handlers will need it too. It is safe to assume that 
parentCollection() always contains a valid parent Collection. But note that it 
only applies to parentCollection().id(), other fields (name, remoteId, etc.) 
may not be populated - that depends on fetch scope of the ETM's Monitor.

Dan

-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20170422/81a679aa/attachment.sig>


More information about the kde-pim mailing list