diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2011-08-10 07:27:18 +0000 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2011-08-10 07:27:18 +0000 |
commit | 2098327cd56f5068654b2516e08770e3f2bccf62 (patch) | |
tree | 817b1386049e7661225605207811707835e8e7f3 /www-client/seamonkey | |
parent | Added missing gunzip line for GeoIPASNum.dat file (bug#376453) (diff) | |
download | gentoo-2-2098327cd56f5068654b2516e08770e3f2bccf62.tar.gz gentoo-2-2098327cd56f5068654b2516e08770e3f2bccf62.tar.bz2 gentoo-2-2098327cd56f5068654b2516e08770e3f2bccf62.zip |
Fixed dates when printing mails
(Portage version: 2.2.0_alpha50/cvs/Linux x86_64)
Diffstat (limited to 'www-client/seamonkey')
-rw-r--r-- | www-client/seamonkey/ChangeLog | 7 | ||||
-rw-r--r-- | www-client/seamonkey/files/seamonkey-2.2-fix-dates-in-mail-printing.patch | 120 | ||||
-rw-r--r-- | www-client/seamonkey/seamonkey-2.2-r2.ebuild | 7 |
3 files changed, 132 insertions, 2 deletions
diff --git a/www-client/seamonkey/ChangeLog b/www-client/seamonkey/ChangeLog index 4dc2a1c2f97f..1932c5368e68 100644 --- a/www-client/seamonkey/ChangeLog +++ b/www-client/seamonkey/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for www-client/seamonkey # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/ChangeLog,v 1.323 2011/08/03 06:55:39 polynomial-c Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/ChangeLog,v 1.324 2011/08/10 07:27:18 polynomial-c Exp $ + + 10 Aug 2011; Lars Wendler <polynomial-c@gentoo.org> seamonkey-2.2-r2.ebuild, + +files/seamonkey-2.2-fix-dates-in-mail-printing.patch: + Fixed dates when printing mails (mozilla bug #669385). Thanks to Martin + Mokrejs for reporting this via mail. *seamonkey-2.2-r2 (03 Aug 2011) diff --git a/www-client/seamonkey/files/seamonkey-2.2-fix-dates-in-mail-printing.patch b/www-client/seamonkey/files/seamonkey-2.2-fix-dates-in-mail-printing.patch new file mode 100644 index 000000000000..61dbbd07ab3c --- /dev/null +++ b/www-client/seamonkey/files/seamonkey-2.2-fix-dates-in-mail-printing.patch @@ -0,0 +1,120 @@ + +# HG changeset patch +# User Jim Porter <squibblyflabbetydoo@gmail.com> +# Date 1312470116 -3600 +# Node ID 65095963557ab64b5de9e462e1daa7a2fd09a43a +# Parent 5ba3c4ec69922759882709ad4d05ac51813bf52a +Bug 669385 - Wrong date format in print preview (and on paper) of today's messages; r=Standard8 + +diff --git a/mailnews/mime/emitters/src/nsMimeBaseEmitter.cpp b/mailnews/mime/emitters/src/nsMimeBaseEmitter.cpp +--- a/mailnews/mime/emitters/src/nsMimeBaseEmitter.cpp ++++ b/mailnews/mime/emitters/src/nsMimeBaseEmitter.cpp +@@ -694,17 +694,19 @@ nsMimeBaseEmitter::AddAllHeaders(const n + } + + //////////////////////////////////////////////////////////////////////////////// + // The following code is responsible for formatting headers in a manner that is + // identical to the normal XUL output. + //////////////////////////////////////////////////////////////////////////////// + + nsresult +-nsMimeBaseEmitter::GenerateDateString(const char * dateString, nsACString &formattedDate) ++nsMimeBaseEmitter::GenerateDateString(const char * dateString, ++ nsACString &formattedDate, ++ PRBool showDateForToday) + { + nsresult rv = NS_OK; + + if (!mDateFormatter) { + mDateFormatter = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + } + +@@ -745,21 +747,21 @@ nsMimeBaseEmitter::GenerateDateString(co + if (displaySenderTimezone) + explodedCompTime = explodedMsgTime; + else + PR_ExplodeTime(PR_ImplodeTime(&explodedMsgTime), PR_LocalTimeParameters, &explodedCompTime); + + PRExplodedTime explodedCurrentTime; + PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &explodedCurrentTime); + +- // if the message is from today, don't show the date, only the time. (i.e. 3:15 pm) +- // if the message is from the last week, show the day of the week. (i.e. Mon 3:15 pm) +- // in all other cases, show the full date (03/19/01 3:15 pm) ++ // If we want short dates, check if the message is from today, and if so ++ // only show the time (e.g. 3:15 pm). + nsDateFormatSelector dateFormat = kDateFormatShort; +- if (explodedCurrentTime.tm_year == explodedCompTime.tm_year && ++ if (!showDateForToday && ++ explodedCurrentTime.tm_year == explodedCompTime.tm_year && + explodedCurrentTime.tm_month == explodedCompTime.tm_month && + explodedCurrentTime.tm_mday == explodedCompTime.tm_mday) + { + // same day... + dateFormat = kDateFormatNone; + } + + nsAutoString formattedDateString; +@@ -804,17 +806,17 @@ nsMimeBaseEmitter::GetLocalizedDateStrin + + if (prefBranch) + prefBranch->GetBoolPref("mailnews.display.original_date", + &displayOriginalDate); + + if (!displayOriginalDate) + { + nsCAutoString convertedDateString; +- nsresult rv = GenerateDateString(dateString, convertedDateString); ++ nsresult rv = GenerateDateString(dateString, convertedDateString, true); + if (NS_SUCCEEDED(rv)) + i18nValue = strdup(convertedDateString.get()); + else + i18nValue = strdup(dateString); + } + else + i18nValue = strdup(dateString); + +diff --git a/mailnews/mime/emitters/src/nsMimeBaseEmitter.h b/mailnews/mime/emitters/src/nsMimeBaseEmitter.h +--- a/mailnews/mime/emitters/src/nsMimeBaseEmitter.h ++++ b/mailnews/mime/emitters/src/nsMimeBaseEmitter.h +@@ -168,14 +168,15 @@ protected: + + // For the format being used... + PRInt32 mFormat; + + // For I18N Conversion... + nsCOMPtr<nsIMimeConverter> mUnicodeConverter; + nsString mCharset; + nsCOMPtr<nsIDateTimeFormat> mDateFormatter; +- nsresult GenerateDateString(const char * dateString, nsACString& formattedDate); ++ nsresult GenerateDateString(const char * dateString, nsACString& formattedDate, ++ PRBool showDateForToday); + // The caller is expected to free the result of GetLocalizedDateString + char* GetLocalizedDateString(const char * dateString); + }; + + #endif /* _nsMimeBaseEmitter_h_ */ +diff --git a/mailnews/mime/emitters/src/nsMimeHtmlEmitter.cpp b/mailnews/mime/emitters/src/nsMimeHtmlEmitter.cpp +--- a/mailnews/mime/emitters/src/nsMimeHtmlEmitter.cpp ++++ b/mailnews/mime/emitters/src/nsMimeHtmlEmitter.cpp +@@ -243,17 +243,17 @@ nsresult nsMimeHtmlDisplayEmitter::Broad + (!extraExpandedHeadersArray.Length() || (ToLowerCase(headerStr), + extraExpandedHeadersArray.IndexOf(headerStr) == + extraExpandedHeadersArray.NoIndex))) + continue; + } + + if (!PL_strcasecmp("Date", headerInfo->name)) + { +- GenerateDateString(headerValue, convertedDateString); ++ GenerateDateString(headerValue, convertedDateString, false); + headerValueEnumerator->Append(convertedDateString); + } + else // append the header value as is + headerValueEnumerator->Append(headerValue); + + headerNameEnumerator->Append(headerInfo->name); + } + + diff --git a/www-client/seamonkey/seamonkey-2.2-r2.ebuild b/www-client/seamonkey/seamonkey-2.2-r2.ebuild index 644e1a78421e..b247e5a7ff97 100644 --- a/www-client/seamonkey/seamonkey-2.2-r2.ebuild +++ b/www-client/seamonkey/seamonkey-2.2-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/seamonkey-2.2-r2.ebuild,v 1.1 2011/08/03 06:55:39 polynomial-c Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/seamonkey-2.2-r2.ebuild,v 1.2 2011/08/10 07:27:18 polynomial-c Exp $ EAPI="3" WANT_AUTOCONF="2.1" @@ -156,6 +156,11 @@ src_prepare() { epatch "${FILESDIR}"/${PN}-2.1b3-restore-tabbar-scrolling-from-2.1b2.diff \ "${FILESDIR}"/${PN}-2.2-curl7217-includes-fix.patch + # mailnews patches go here + pushd "${S}"/mailnews &>/dev/null || die + epatch "${FILESDIR}"/${PN}-2.2-fix-dates-in-mail-printing.patch + popd &>/dev/null || die + # Allow user to apply any additional patches without modifing ebuild epatch_user |