[Kde-pim] fixing mbox - general Akonadi problem ?

Martin Koller kollix at aon.at
Wed Feb 12 18:07:53 GMT 2014


On Wednesday 12 February 2014 18:54:43 Daniel Vrátil wrote:
> On Wednesday 12 of February 2014 18:22:40 Martin Koller wrote:
> > On Wednesday 12 February 2014 17:41:26 Daniel Vrátil wrote:
> > > When you delete a mail from MboxResource::itemRemoved() and there are more
> > > items waiting for deletion in ChangeRecorder's pipeline, it's necessary to
> > > modify RIDs of all emails affected by the compaction BEFORE
> > > changeProcessed() is called. This should cause all other items pending
> > > deletion in
> > > ChangeRecorder's pipeline to be refetched from Akonadi with updated RID.
> > 
> > I tried that but that still fails because I try to modify all other moved
> > entries via the following code where I want to retrieve the other Akonadi
> > Items via an ItemFetchJob but obviously during the exec() event loop, I
> > just get the next call to MboxResource::itemRemoved() :-(
> > 
> > Is that completely wrong what I do here ?
> > 
> >     // change all remoteIds of the moved items (all items after the deleted
> > one change their offset in the file)
> >   if ( !movedEntries.isEmpty() ) {
> >       qDebug() << "#movedEntries=" << movedEntries.count();
> >       Item::List movedItems;
> >       const QString colId = QString::number( mboxCollection.id() );
> >       const QString colRid = mboxCollection.remoteId();
> >       foreach (const KMBox::MBoxEntry::Pair &p, movedEntries) {
> >         Item movedItem;
> 
> If it's not too difficult (and slow) to extract Message-ID headers from each 
> message, you might want to use setGID() instead of setRemoteId(). The reason 
> is that in the database the GID column has an index, while remoteId column 
> does not, so looking up the items based on GID will be faster.

Thanks for your hints, but my main problem is: how can I avoid that the exec() call
of the Job does not continue with the next MboxResource::itemRemoved() call ?
Can I stop the ChangeRecorder somehow ? Is it simply a Qt disconnect() or how ?

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
_______________________________________________
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