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

List:       kmail-devel
Subject:    Bug#30475: crash when typing f while kmail starts
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <ingo.kloecker () epost ! de>
Date:       2001-08-19 9:54:32
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sonntag, 19. August 2001 00:29, Ingo Klöcker wrote:
> No. But I found the cause of the crash. KMail crashes in the
> following line
>
>   win->setCharset(msg->codec()->name(), TRUE);
>
> near the end of KMHeaders::forwardMsg(). The reason for the crash is
> msg->codec() == NULL.
> I guess the codec of the current message still hasn't been
> initialized when the forward action is processed.
>
> The attached simple patch will prevent this crash.
>
> This fix will have to be applied to all message related actions, e.g.
> KMHeaders::redirectMsg(), KMHeaders::replyToMsg(), etc., because they
> all contain the above line. (I haven't tried if they all crash
> KMail.)

KMail does indeed also crash if you hold down 'r' or 'e', etc., while 
KMail starts.

The attached patch fixes this problem in all cases.

Regards,
Ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7f4zdGnR+RTDgudgRAsp5AKDKX5056Tr49urK9AELNf6OLCayPwCfWDZb
Jha1Dz1u6uFRhqF8tmZQxo4=
=Y/qk
-----END PGP SIGNATURE-----

["kmheaders.cpp.diff" (text/x-diff)]

Index: kmheaders.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmheaders.cpp,v
retrieving revision 1.314
diff -u -3 -p -r1.314 kmheaders.cpp
--- kmheaders.cpp	2001/08/15 16:11:18	1.314
+++ kmheaders.cpp	2001/08/19 09:46:16
@@ -1177,7 +1177,7 @@ void KMHeaders::resendMsg ()
 {
   KMComposeWin *win;
   KMMessage *newMsg, *msg = currentMsg();
-  if (!msg) return;
+  if (!msg || !msg->codec()) return;
 
   kernel->kbp()->busy();
   newMsg = new KMMessage;
@@ -1335,7 +1335,7 @@ void KMHeaders::forwardMsg ()
   // forward a single message at most.
 
   KMMessage *msg = currentMsg();
-  if (!msg) return;
+  if (!msg || !msg->codec()) return;
 
   QString id = msg->headerField( "X-KMail-Identity" );
   if ( id.isEmpty() )
@@ -1411,7 +1411,7 @@ void KMHeaders::redirectMsg()
   KMComposeWin *win;
   KMMessage *msg = currentMsg();
 
-  if (!msg) return;
+  if (!msg || !msg->codec()) return;
 
   kernel->kbp()->busy();
   win = new KMComposeWin();
@@ -1429,7 +1429,7 @@ void KMHeaders::noQuoteReplyToMsg()
   KMMessage *msg = currentMsg();
   QString id;
 
-  if (!msg)
+  if (!msg || !msg->codec())
     return;
 
   kernel->kbp()->busy();
@@ -1450,7 +1450,7 @@ void KMHeaders::replyToMsg (QString sele
   KMMessage *msg = currentMsg();
   QString id;
 
-  if (!msg)
+  if (!msg || !msg->codec())
     return;
 
   kernel->kbp()->busy();
@@ -1472,7 +1472,7 @@ void KMHeaders::replyAllToMsg (QString s
   KMMessage *msg = currentMsg();
   QString id;
 
-  if (!msg) return;
+  if (!msg || !msg->codec()) return;
 
   kernel->kbp()->busy();
   id = msg->headerField( "X-KMail-Identity" );
@@ -1492,7 +1492,7 @@ void KMHeaders::replyListToMsg (QString 
   KMMessage *msg = currentMsg();
   QString id;
 
-  if (!msg) return;
+  if (!msg || !msg->codec()) return;
 
   kernel->kbp()->busy();
   id = msg->headerField( "X-KMail-Identity" );

_______________________________________________
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