[Kde-pim] Review Request: Refactor filtering related code, so the whole payload is not requested when not needed
Andras Mantia
amantia at kde.org
Sun Oct 14 19:25:27 BST 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106853/
-----------------------------------------------------------
Review request for KDEPIM.
Description
-------
This is a big refactoring that extends the behavior that we should required only parts that are really needed. Before this, the needed parts were determined based on all available filters.
With this refactoring, except in some manual filtering cases, only the filters that are valid for the collection where the item is are taken into account.
For example, if there was a spam filtering for POP3 (that required the whole body), when a mail arrived in an online IMAP account, the full body was requested even if the filter had the option to apply only for non-IMAP accounts. Now only the enveloper will be requested for IMAP (unless there are other filters VALID for IMAP needing more).
To make the code more clear, the DBUS API for mailfilteragent is changed, but this is no problem, as the only user of that so far is KMail, which is updated. This is internal to "kdepim".
The change also removes some method overrides to avoid confusion and code duplication. Now all methods (except when we go through dbus) work on Akonadi::Item instead of item ids (that were qlonglong and not qint64 how it is defined...). This adds a little performance penalty, but the less code worths it imo.
Basic testing was done, and I will commit only to master if nobody objects and of course continue testing daily. :)
An upcoming patch will come to address the issue of duplicating mails in case of move + flag change case.
Diffs
-----
kmail/kmcommands.h 5e83644
kmail/kmcommands.cpp 7a9b7a2
kmail/kmmainwidget.h 52e4a33
kmail/kmmainwidget.cpp ada9f8b
mailcommon/filter/filtermanager.h eb2f2d5
mailcommon/filter/filtermanager.cpp d71b91e
mailcommon/filter/itemcontext.h 89659ba
mailcommon/filter/itemcontext.cpp 2ef50c5
mailcommon/filter/kmfilterdialog.h 1b6964e
mailcommon/filter/kmfilterdialog.cpp 37888f4
mailcommon/filter/mailfilter.h c594333
mailcommon/filter/mailfilter.cpp c8f0b2d
mailfilteragent/dbusoperators.h bd03f9a
mailfilteragent/filtermanager.h 17457a8
mailfilteragent/filtermanager.cpp 29a7580
mailfilteragent/mailfilteragent.h 25910f4
mailfilteragent/mailfilteragent.cpp bcbc9f6
mailfilteragent/org.freedesktop.Akonadi.MailFilterAgent.xml 3f651f1
Diff: http://git.reviewboard.kde.org/r/106853/diff/
Testing
-------
Thanks,
Andras Mantia
_______________________________________________
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