[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: Serial number-related trouble, again
From:       Don Sanders <sanders () kde ! org>
Date:       2005-05-30 1:09:22
Message-ID: 200505301109.23167.sanders () kde ! org
[Download RAW message or body]

On Friday 27 May 2005 19:11, David Faure wrote:
> On Friday 27 May 2005 03:25, Don Sanders wrote:
> > You can't have two different messages (an original and a copy)
> > with different serial numbers. A serial number relates to a
> > unique message in a particular folder at a particular offset
> > within the index.
>
> OK, this helps a lot.

Shocking stuff ;)

> Then the bug is simply this line: 
>
> void KMMainWidget::slotMsgActivated(KMMessage *msg)
> {
>    [...]
>   KMReaderMainWin *win = new KMReaderMainWin( mFolderHtmlPref );
>   KMMessage *newMessage = new KMMessage(*msg);
>   newMessage->setParent( msg->parent() );
>   newMessage->setMsgSerNum( msg->getMsgSerNum() ); <<<<<<<<<<<<<<<<
>   newMessage->setReadyToShow( true );
>   win->showMsg( mCodec, newMessage );
>   win->show();
> }
>
> That line was added as part of the fixes for
> http://bugs.kde.org/show_bug.cgi?id=71385

What a wonderful bug report, such a nice list of changes,
and all so relevant too.

> If I remove the setMsgSerNum call, then "Save As" from the separate
> reader window fails indeed. This is because of:
> void KMSaveMsgCommand::slotSaveDataReq()
> {
>    [...]
>    kmkernel->msgDict()->getLocation( mMsgList[mMsgListIndex], &p,
> &idx ); assert( p );
>    [...]
> }
> (it obviously can't look up the message by serial number since it
> has none)

Ok.

> So...... why do we make a copy of the message in the first place? I
> guess "because it might be deleted", but that's wrong thinking,
> since KMReaderWin only remembers the serial number of the message,
> not the KMMessage pointer.

I'm with you.

> Things work OK again if I remove the KMMessage copying in
> KMMainWidget::slotMsgActivated, and if I disable
> auto-deletion-of-the-message in this case (new ctor argument so
> that it doesn't affect other uses of KMReaderWin, there's no serial
> number when viewing an attached mail,  so 

(missing no here? so no autodeletion is needed)

> autodeletion is needed).  

This seems like a logical approach to take.

> However a new bug appears: after saving a message (from the
> separate reader window), the header list goes blank !?!?!?

That's a crying shame. Off the top of my head I'm 
not sure why that would be. Maybe Till has some 
idea on this as according to the bug report referenced 
above he got the save as code working again after I 
disabled it.

Don Sanders.
_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic