[Kde-pim] Trying to understand mail filtering handling with maildir resource
Daniel Vrátil
dvratil at redhat.com
Tue Jul 15 15:20:56 BST 2014
On Tuesday 15 of July 2014 15:35:20 Martin Steigerwald wrote:
> 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?
qDebug() is printed always, only kDebug is affected by kdebugdialog.
Dan
>
> Ciao,
--
Daniel Vrátil | dvratil at redhat.com | dvratil on #kde-devel, #kontact, #akonadi
KDE Desktop Team
Associate Software Engineer, Red Hat
GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140715/11f6bb6c/attachment.sig>
-------------- 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