[Kde-pim] mbox resource

Martin Koller kollix at aon.at
Wed Feb 5 20:53:39 GMT 2014


On Wednesday 05 February 2014 21:34:59 Ingo Klöcker wrote:
> On Wednesday 05 February 2014 10:41:21 laurent Montel wrote:
> > On mardi 4 février 2014 17:09:52 Martin Koller wrote:
> > > On Tuesday 04 February 2014 15:51:39 Daniel Vrátil wrote:
> > > > On Monday 03 of February 2014 21:11:37 Martin Koller wrote:
> > > > > Hi,
> > > > > 
> > > > > I'm debugging the mbox resource and find a strange thing.
> > > > > When I append a new message from the shell (simulating an
> > > > > external
> > > > > program
> > > > > appending a new message) then
> > > > > SingleFileResourceBase::fileChanged() gets called which in turn
> > > > > lands in MboxResource::writeToFile().
> > > > > There the given filename is a temporary file, e.g.
> > > > > /home/kdetrunk/.kde4/share/apps/akonadi_mbox_resource_0/mbox-1
> > > > > to which the whole current mbox file is copied via mMBox->save(
> > > > > fileName )
> > > > > 
> > > > > But then follows something I do not understand.
> > > > > The comment in this file says something like
> > > > > "... Therefore we
> > > > > 
> > > > >   // copy the original file and append pending changes to it but
> > > > >   also
> > > > >   add an
> > > > > 
> > > > > extra // '\n' to make sure that the hashes differ and the user
> > > > > gets
> > > > > notified. ..."
> > > > > 
> > > > > But in fact it destroys what it has just written via
> > > > > 
> > > > >     QFile file( fileName );
> > > > >     file.open( QIODevice::WriteOnly );
> > > > >     file.seek( file.size() );
> > > > >     file.write( "\n" );
> > > > > 
> > > > > QIODevice::WriteOnly is not
> > > > > QIODevice::WriteOnly|QIODevice::Append even with the seek() so
> > > > > I assume that this is simply a bug, right ?> > 

<snip>

> Good catch, Martin!

I can easily change that code, but first I want to understand:
why the heck does it do that writing to a kind of backup file
at all and what happens with that file afterwards ?
(Even with that bug currently, it seems it does not make any difference, e.g. I see all mails)

checking the open bug reports about the mbox resource, I get the feeling it does not
work correctly.

Who is the current maintainer of the mbox code (meaning: who knows the details
of the implementation - why was it done that way, etc.) ?

-- 
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