arthur.bebou

Le site arthur.bebou.netlib.re - retour accueil

git clone git://bebou.netlib.re/arthur.bebou
Log | Files | Refs |

display_author.patch (1306B)


      1 From 8ed9162034fa2861eb06f54644c46b5e4d487401 Mon Sep 17 00:00:00 2001
      2 From: Arthur Pons <arthur.pons@unistra.fr>
      3 Date: Fri, 21 Oct 2022 14:48:55 +0200
      4 Subject: [PATCH] Display author name instead of date on row item
      5 
      6 ---
      7  sfeed_curses.c | 8 ++++----
      8  1 file changed, 4 insertions(+), 4 deletions(-)
      9 
     10 diff --git a/sfeed_curses.c b/sfeed_curses.c
     11 index 4d2b698..687b1fe 100644
     12 --- a/sfeed_curses.c
     13 +++ b/sfeed_curses.c
     14 @@ -1818,17 +1818,17 @@ item_row_format(struct pane *p, struct row *row)
     15  
     16  	item = row->data;
     17  
     18 -	needsize = strlen(item->fields[FieldTitle]) + 21;
     19 +	needsize = strlen(item->fields[FieldTitle]) + strlen(item->fields[FieldAuthor]) + 21;
     20  	if (needsize > textsize) {
     21  		text = erealloc(text, needsize);
     22  		textsize = needsize;
     23  	}
     24  
     25  	if (item->timeok && localtime_r(&(item->timestamp), &tm)) {
     26 -		snprintf(text, textsize, "%c %04d-%02d-%02d %02d:%02d %s",
     27 +		snprintf(text, textsize, "%c %-25s %s",
     28  		         item->fields[FieldEnclosure][0] ? '@' : ' ',
     29 -		         tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
     30 -		         tm.tm_hour, tm.tm_min, item->fields[FieldTitle]);
     31 +		         item->fields[FieldAuthor],
     32 +		         item->fields[FieldTitle]);
     33  	} else {
     34  		snprintf(text, textsize, "%c                  %s",
     35  		         item->fields[FieldEnclosure][0] ? '@' : ' ',
     36 -- 
     37 2.30.2
     38