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

List:       kde-commits
Subject:    kdenetwork/kmail
From:       "Christophe Prud'homme" <prudhomm () debian ! org>
Date:       2002-12-07 14:11:03
[Download RAW message or body]

CVS commit by prudhomm: 

I got tired of the crashes while filtering IMAP folders
I thought the bug would be complex
hell no it was so trivial 

now mTransferInProgress is a bool 
it is meant to be a bool and not a int
see the code below on how the coder simulated a bool 
with an int
  value ? ++mTransferInProgress : --mTransferInProgress;

then the coder puts this assert !
  assert(mTransferInProgress >= 0 && mTransferInProgress <= 1);

 Incredible no ?

let's see for example how this is called from kmforlderimap.cpp

  for ( KMMessage* msg = msgList.first(); msg; msg = msgList.next() )
      msg->setTransferInProgress(true);

Ouuch !


  M +1 -2      kmmessage.cpp   1.346
  M +1 -1      kmmessage.h   1.114


--- kdenetwork/kmail/kmmessage.cpp:1.345	Sat Dec  7 10:45:42 2002
@@ -3477,8 +3477,7 @@
 //-----------------------------------------------------------------------------
 void KMMessage::setTransferInProgress(bool value)
 {
-  value ? ++mTransferInProgress : --mTransferInProgress;
-  assert(mTransferInProgress >= 0 && mTransferInProgress <= 1);
+  mTransferInProgress = value;
 }
 
 
--- kdenetwork/kmail/kmmessage.h:1.113	Sat Nov 30 21:07:35 2002
@@ -682,7 +682,7 @@
   mutable DwMessage* mMsg;
   mutable bool mNeedsAssembly;
   bool mIsComplete, mDecodeHTML;
-  int mTransferInProgress;
+  bool mTransferInProgress;
   static int sHdrStyle;
   static QString sForwardStr;
   const QTextCodec* mCodec;

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

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