[Kde-pim] mailfilter does not see all incoming messages

Wolfgang Rohdewald wolfgang at rohdewald.de
Tue Feb 26 12:34:36 GMT 2013


Am Mittwoch, 13. Februar 2013, 10:34:46 schrieb Wolfgang Rohdewald:
> my filter for incoming mail does not get noticed of all new mails.
> if I get 10 mails (sent by myself from somewhere else), between 0 and 3
> remain in inbox. The ignored mails are always some of the last ones,
> the first 5 mails always get through to mailfilter.

what happens:

MonitorPrivate::dispatchNotifications() deqeues a msg
from pendingNotifications

This emits itemChanged
processing that signal indirectly calls ChangeRecorder::changeProcessed()
which dequeues a message from pendingNotifications. This is the
lost message. This only happens sometimes - only if pendingNotifications
is not empty.

There are two dequeues for one message, so one of them is too much.

I now removed one call to changeProcessed() from mailfilteragent
by overriding 
AgentBase::Observer::itemChanged (which does call changeProcessed)
with an empty version which does not call changeProcessed.

This seems to work. Patch attached. Please review - if OK, I will commit
to 4.10 and merge to master.

But then I do not understand some comments in changerecorder.cpp
like
      // The msg is now in both pipeline and pendingNotifications.
      // When data is available, MonitorPrivate::flushPipeline will emitNotification.
      // When changeProcessed is called, we'll finally remove it from pendingNotifications.

it seems to me that the API of Monitor and ChangeRecorder can easily be misunderstood
and wrongly used. The API doc certainly does not say that slots like itemAdded must
call changeProcessed. But then the default implementations in AgentBase::Monitor::itemAdded etc
do call it. Which one is correct? If the slots should not call changeProcessed, who should in light
of the comment above?


-- 
Wolfgang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mailfilter.patch
Type: text/x-patch
Size: 1197 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20130226/97e2d479/attachment.bin>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list