tags 667973 patch upstream
thanks
On 2012-06-16 20:38:52 +0200, Lars Windolf wrote:
> Sorry guys. I dropped it for simplicity. As less and less work goes
> into Liferea minor use cases have to be dropped for maintainting the
> whole thing.
I really hate the default date format. I've attached an old patch that
still works for me (IIRC, it just re-adds the old code). Concerning
simplicity, making just the date configurable by the user is much
simpler than the whole complex (and broken) date_format_nice function.
> The idea was to radically simplify the date formatting by relying
> only on a single glib method... (which ATM is not yet possible due
> to a glib bug...).
Do you mean that date formatting should be provided by glib?
If it is itself configurable, then yes, that would be the best
solution.
--
Vincent Lefèvre <[email protected]> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
diff -Naurd liferea-1.8.0.old/src/date.c liferea-1.8.0.new/src/date.c
--- liferea-1.8.0.old/src/date.c 2011-11-28 21:50:57.000000000 +0000
+++ liferea-1.8.0.new/src/date.c 2011-12-24 21:31:07.000000000 +0000
@@ -141,7 +141,20 @@
result = g_new0 (gchar, TIMESTRLEN);
e_utf8_strftime_fix_am_pm (result, TIMESTRLEN, date_format,
&date_tm);
} else {
- result = date_format_nice (date);
+ gchar *fmt;
+ conf_get_str_value ("/apps/liferea/date-format", &fmt);
+ if (fmt && !strlen (fmt)) {
+ g_free (fmt);
+ fmt = NULL;
+ }
+ if (fmt) {
+ localtime_r (&date, &date_tm);
+ result = g_new0 (gchar, TIMESTRLEN);
+ e_utf8_strftime_fix_am_pm (result, TIMESTRLEN, fmt,
&date_tm);
+ g_free (fmt);
+ } else {
+ result = date_format_nice (date);
+ }
}
return result;