[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: kdenetwork/kmail
From: Karl-Heinz Zimmer <khz () kde ! org>
Date: 2002-09-30 13:27:02
[Download RAW message or body]
Hi Stephan,
I changed this to make it compile but I /might/ have done it wrong, please
have a look at what I did:
void KMImapJob::slotGetMessageResult(KIO::Job * job)
{
- KMMessage *msg = mMsgList.first();
+ if( !mMsg )
+ return;
+ KMMessage *msg = mMsg; // was: mMsgList.first();
+ // This did not compile since mMsgList
+ // is not a member of KMImapJob.
KMFolderImap * folder = static_cast<KMFolderImap*>(msg->parent());
if (!folder) // guarded ptr - can be 0
return;
Cheers
Karl-Heinz
On Monday 30 September 2002 11:24, Stephan Kulow wrote:
> kdenetwork/kmail kmfolderimap.cpp,1.68,1.69
> Author: coolo
>
>
> Modified Files:
> kmfolderimap.cpp
> Log Message:
> trying to fix this crash:
> #0 0x4013ea80 in QGuardedPtrPrivate::object() const (this=0x0)
> at /coolo/prod/qt-copy/include/qguardedptr.h:131
> #1 0x4016b352 in QGuardedPtr<KMAcctImap>::operator KMAcctImap*() const
> (this=0x91627f8) at /coolo/prod/qt-copy/include/qguardedptr.h:112
> #2 0x4016afd4 in KMFolderImap::account() (this=0x91626c0)
> at /coolo/prod/kdenetwork/kmail/kmfolderimap.h:103
> #3 0x40245146 in KMImapJob::slotGetMessageResult(KIO::Job*)
> (this=0x8bf1ef0, job=0x8adbc18) at
> /coolo/prod/kdenetwork/kmail/kmfolderimap.cpp:1163
>
> - KMAcctImap *account =
> static_cast<KMFolderImap*>(mMsg->parent())->account(); + KMMessage *msg =
> mMsgList.first();
> + KMFolderImap * folder = static_cast<KMFolderImap*>(msg->parent());
> + if (!folder) // guarded ptr - can be 0
> + return;
> + KMAcctImap *account = folder->account();
>
> (there seems to be more places in the code where this construct is used
> though) CCMAIL: kmail@kde.org
--
Karl-Heinz Zimmer, Senior Software Engineer, Klarälvdalens Datakonsult AB
<mailto:khz@klaralvdalens-datakonsult.se> <mailto:khz@kde.org>
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic