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

List:       kmail-devel
Subject:    Re: Serial number-related trouble, again
From:       Carsten Burghardt <burghardt () kde ! org>
Date:       2005-05-26 15:35:49
Message-ID: 200505261735.49770.burghardt () kde ! org
[Download RAW message or body]

On Thursday 26 May 2005 17:24, David Faure wrote:
> Similarly, this assumption in KMReaderWin::setMsg is simply broken:
>
>   // assume if a serial number exists it can be used to find the assoc
> KMMessage if (mLastSerNum <= 0)
>     mMessage = aMsg;
>   else
>     mMessage = 0;
>   if (message() != aMsg) {
>     mMessage = aMsg;
>     mLastSerNum = 0; // serial number was invalid
>     Q_ASSERT(0);
>   }
>
> where message() does
>
>     kmkernel->msgDict()->getLocation( mLastSerNum, &folder, &index );

Oops.

> This isn't going to work, ever, since the KMMessage that is in the folder
> is the initial one (the one we made a copy of, in kmmainwidget.cpp),
> and the KMMessage we're comparing it to (aMsg) is the copy.
> So message() != aMsg, always (at least when coming from
> KMMainWidget::slotMsgActivated)
>
> How about the following simplification, to fix the broken assumption and
> the Q_ASSERT(0) happening all the time? We shouldn't need to run self-tests
> at runtime, especially when we know they're going to fail because aMsg is a
> copy :)

Looks good but I'm not 100% sure that this works in all cases. Nevertheless 
this is much cleaner so I'm pro committing.


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