[ekg2-commit] ekg2: main.c (HEAD) old.c (HEAD) [darkjames]

CVS commit cvs w amba.bydg.pdi.net
Pią, 16 Lut 2007, 21:59:12 CET


Module name:	ekg2
Changes by:	darkjames	07/02/16 21:59:08

Modified files:
	main.c old.c

Log message:
[ncurses] implement support for config_lastlog_noitems

Index: main.c
===================================================================
RCS file: /home/cvs/ekg2/plugins/ncurses/main.c,v
diff -d -u -r1.83 -r1.84
--- main.c	16 Feb 2007 18:06:43 -0000	1.83
+++ main.c	16 Feb 2007 20:59:07 -0000	1.84
@@ -407,8 +407,8 @@
 	}
 
 	config_lastlog_lock = 0;
-	if (!(retval = n->handle_redraw(w))) {
-		/* if no items, destroy.. */
+	if (!(retval = n->handle_redraw(w)) && !config_lastlog_noitems) {	/* if we don't want __backlog wnd when no items founded.. */
+		/* destroy __backlog */
 		window_kill(w, 1);
 		config_lastlog_lock = lock_old;
 /* XXX bugnotes, when killing visible w->floating window we should do: implement in window_kill() */

Index: old.c
===================================================================
RCS file: /home/cvs/ekg2/plugins/ncurses/old.c,v
diff -d -u -r1.130 -r1.131
--- old.c	16 Feb 2007 20:11:18 -0000	1.130
+++ old.c	16 Feb 2007 20:59:07 -0000	1.131
@@ -2322,7 +2322,7 @@
 	if (!w || !(n = w->private))
 		return items;
 
-	{	/* add header */
+	if (config_lastlog_noitems) {	/* always add header */
 		char *tmp = format_string(header, window_target(w), lastlog->expression);
 		ncurses_backlog_add(lastlog_w, fstring_new(tmp));
 		xfree(tmp);
@@ -2354,6 +2354,12 @@
 				found = !!xstrstr(n->backlog[i]->str, lastlog->expression);
 			else	found = !!xstrcasestr(n->backlog[i]->str, lastlog->expression);
 		}
+
+		if (!config_lastlog_noitems && found && !items) { /* add header only when found */
+			char *tmp = format_string(header, window_target(w), lastlog->expression);
+			ncurses_backlog_add(lastlog_w, fstring_new(tmp));
+			xfree(tmp);
+		}
 		
 		if (found) {
 			fstring_t *dup;


Więcej informacji o liście dyskusyjnej ekg2-commit