[Kde-pim] Trying to understand mail filtering handling with maildir resource

Martin Steigerwald Martin at lichtvoll.de
Tue Jul 15 14:35:20 BST 2014


Am Montag, 14. Juli 2014, 11:13:23 schrieb Daniel Vrátil:
> > In several places in maildir resource itself I see calls to a function to
> > stop maildir scanning before a call into libmaildir, like in
> >
> > maildirresource.cpp:
> > 
> >
> > 419   stopMaildirScan( sourceDir );
> > 420   stopMaildirScan( destDir );
> > 421
> > 422   const QString newRid = sourceDir.moveEntryTo( item.remoteId(),
> > destDir );
> > 423
> > 424   mChangedFiles.insert( newRid );
> > 425   mChangedCleanerTimer->start( CLEANER_TIMEOUT );
> > 426
> > 427   restartMaildirScan( sourceDir );
> > 428   restartMaildirScan( destDir );
> >
> > 
> > 
> >
> > This basically disabled the filesystem watcher:
> > 
> >
> > 855 void MaildirResource::stopMaildirScan(const Maildir &maildir)
> > 856 {
> > 857     const QString path = maildir.path();
> > 858     mFsWatcher->stopDirScan( path + QLatin1Literal( "/new" ) );
> > 859     mFsWatcher->stopDirScan( path + QLatin1Literal( "/cur" ) );
> > 860 }
> > 861
> > 862 void MaildirResource::restartMaildirScan(const Maildir &maildir)
> > 863 {
> > 864     const QString path = maildir.path();
> > 865     mFsWatcher->restartDirScan( path + QLatin1Literal( "/new" ) );
> > 866     mFsWatcher->restartDirScan( path + QLatin1Literal( "/cur" ) );
> > 867 }
> >
> > 
> > 
> >
> > Okay, it boils down to where
> >
> > 
> >
> > 711 void MaildirResource::slotDirChanged(const QString& dir)
> >
> > 
> >
> > is called.
> >
> > 
> >
> > If its called on filesystem changes detected by inotify, I think thats
> > fine.>
> > 
> > 
> >
> > But if its triggered on filtering a mail into a new folder, then I think
> > thats a bug. Yet, moving a mail with maildirresource exactly should not
> > trigger it.
> 
> I think this ^^^ is the bug that you are hunting down - even though
> filesystem  watcher has been temporarily disabled for the move, the
> slotDirChanged is still called - maybe it's called for parent folder? Or
> maybe
> stopDirScan(path/{new,cur}) is not enough and some other folder has to be 
> unwatched temporarily?
> 
> Adding a simple qDebug() << dir to slotDirChanged() will tell you more.

Thanks, Dan, for your detailed explainations. I will review these.

I will look in that direction in my next free time slot for that.

I will see the output of qDebug() in ~/.xsession-errors if enabled in 
kdebugdialog?

Ciao,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7
_______________________________________________
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