[Bug 182208] messages passed through a pipe does not get updated in the main window

Matthias Gehre M.Gehre at gmx.de
Fri Mar 20 00:55:38 GMT 2009


https://bugs.kde.org/show_bug.cgi?id=182208





--- Comment #8 from Matthias Gehre <M Gehre gmx de>  2009-03-20 01:55:37 ---
I finally got it working with my local changes to kmail trunk.
But I do not want to introduce any further hacks to the code, so I need some
assistance concerning the creation of the patches.
These are the problems I discovered:

1. kmfilteraction.cpp:1721
PipeJob *job = new PipeJob(0, aMsg, commandLine, tempFileName);
QObject::connect ( job, SIGNAL( done() ),
                     handler, SLOT( actionMessage() ) );
This fails to connect and so actionMessage is never called after a PipeJob.
I manually added a call to actionMessage() at the end of PipeJob::run(), but
this is not how it should be solved. Should be pretty obvious to fix, but
unfortunatly I'm no Qt guy, so could someone have a look at it?
This fixes the "After 'Pipe Througth' on IMAP, filterings stalls"

2.
--- kmcommands.cpp    (revision 941185)
+++ kmcommands.cpp    (working copy)
@@ -1739,9 +1739,19 @@
  void KMMetaFilterActionCommand::start()
 {
-  if ( ActionScheduler::isEnabled() && false ) { // don't use it for now
+  if ( ActionScheduler::isEnabled() 
+    || kmkernel->filterMgr()->atLeastOneOnlineImapFolderTarget() ) {
This function is executed when the user chooses to run only one filter (from
the menu or toolbar). My patch makes it use the ActionScheduler when we are
working on IMAP, exactly
as the Ctrl-J behavior currently is.

3. Later in the same function
KMFilterMgr::FilterSet set = KMFilterMgr::All;
QList<KMFilter*> filters;
filters.append( mFilter );
ActionScheduler *scheduler = new ActionScheduler( set, filters );
In trunk, filters, that are not executed on incoming mail, not on outgoing mail
and not on manual filtering (ctrl+j), are not executed on explicit user wish.
They are compared to the FilterSet mask (All = Inbound|Outbound|Explicit) and
this test fails.
So I tried to use KMFilterMgr::FilterSet set = KMFilterMgr::NoSet
and in ActionScheduler::filterMessage():
--- actionscheduler.cpp    (revision 941185)
+++ actionscheduler.cpp    (working copy)
@@ -624,7 +624,8 @@
       ((mSet & KMFilterMgr::Inbound) && (*mFilterIt)->applyOnInbound() &&
        (!mAccount ||
         (mAccount && (*mFilterIt)->applyOnAccount(mAccountId)))) ||
-      ((mSet & KMFilterMgr::Explicit) && (*mFilterIt)->applyOnExplicit())) {
+      ((mSet & KMFilterMgr::Explicit) && (*mFilterIt)->applyOnExplicit()) ||
+       (mSet == KMFilterMgr::All)) {

       // filter is applicable
     if ( FilterLog::instance()->isLogging() ) {
But here I am stuck: After setting set = KMFilterMgr::NoSet,
ActionScheduler::filterMessage is not even executed. Maybe this one is obvious,
too, to someone more confident with the codebase.

4. A Patch to keep the X-UID field after using "Pipe Through" with
ActionScheduler (see above)
I copied the code from the corresponding kmfilter function. This one can be
applied as is.

Please excuse if I did something obviously wrong - its my first time with the
kmail sources.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list