[Kde-pim] fixing mbox - general Akonadi problem ?
Ingo Klöcker
kloecker at kde.org
Wed Feb 12 18:14:19 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.
Do I understand correctly that you propose to use Message-Ids as unique
identifiers (GIDs)?
I don't think that using Message-Ids as unique identifiers is a good
idea. There are many broken scripts sending emails with non-unique
Message-Ids.
Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140212/2bf5950f/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