From kmail-devel Wed Sep 17 04:12:35 2003 From: Wolfgang Rohdewald Date: Wed, 17 Sep 2003 04:12:35 +0000 To: kmail-devel Subject: [PATCH] fix wrong warning X-MARC-Message: https://marc.info/?l=kmail-devel&m=106377199005919 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_z89Z/0UHzAZNlcI" --Boundary-00=_z89Z/0UHzAZNlcI Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline the attached message generates QDate::setYMD: Invalid date 1090617968-1090593784-1090616096 The attached patch fixes this. Beware - there is another identical piece of code in the same file which should probably be fixed too. Could somebody please apply this? -- Wolfgang --Boundary-00=_z89Z/0UHzAZNlcI Content-Type: message/rfc822; name="forwarded message" Content-Transfer-Encoding: 7bit Content-Description: Brad Hards : Re: Newbie Guide to Building KDE from CVS. Comments sought. Content-Disposition: inline Date: Tue, 16 Sep 2003 17:56:43 +1000 From: Brad Hards To: kde-devel@kde.org Subject: Re: Newbie Guide to Building KDE from CVS. Comments sought. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 There are some - mainly in kdesdk by the looks. Brad -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE/ZsI8W6pHgIdAuOMRAtH0AJ4jOhrs/xC2g7lLVSeq63VP9+reBQCgu7vg zETJMMhnnTkoEzTprgN5N2M= =Jlad -----END PGP SIGNATURE----- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_z89Z/0UHzAZNlcI Content-Type: text/x-diff; charset="us-ascii"; name="date.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="date.patch" --- old.cpp 2003-09-17 05:42:41.000000000 +0200 +++ objecttreeparser.cpp 2003-09-17 06:06:20.000000000 +0200 @@ -2317,16 +2317,18 @@ } else { if( !block.keyId.isEmpty() ) { - bool dateOK = (0 < block.creationTime.tm_year); - QDate created( 1900 + block.creationTime.tm_year, + bool dateOK = ((0 < block.creationTime.tm_year) && (block.creationTime.tm_year<3000)); + if( dateOK ) { + QDate created( 1900 + block.creationTime.tm_year, block.creationTime.tm_mon, block.creationTime.tm_mday ); - if( dateOK && created.isValid() ) - htmlStr += i18n( "Message was signed with unknown key %1, created %2." ) + if( created.isValid() ) + htmlStr += i18n( "Message was signed with unknown key %1, created %2." ) .arg( keyWithWithoutURL ).arg( created.toString( Qt::LocalDate ) ); - else - htmlStr += i18n( "Message was signed with unknown key %1." ) + else + htmlStr += i18n( "Message was signed with unknown key %1." ) .arg( keyWithWithoutURL ); + } } else htmlStr += i18n( "Message was signed with unknown key." ); --Boundary-00=_z89Z/0UHzAZNlcI Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail Developers mailing list kmail@mail.kde.org http://mail.kde.org/mailman/listinfo/kmail --Boundary-00=_z89Z/0UHzAZNlcI--