diff src/view_file.c @ 1432:cf4029d10d38

improved notification system
author nadvornik
date Sat, 14 Mar 2009 17:21:35 +0000
parents 5a534e1501e1
children a3d3208b0c50
line wrap: on
line diff
--- a/src/view_file.c	Sat Mar 14 11:26:43 2009 +0000
+++ b/src/view_file.c	Sat Mar 14 17:21:35 2009 +0000
@@ -824,10 +824,12 @@
 	ViewFile *vf = data;
 	gboolean refresh;
 
-	if (vf->refresh_idle_id != -1) return;
+	NotifyType interested = NOTIFY_CHANGE | NOTIFY_REREAD | NOTIFY_GROUPING;
+	if (vf->marks_enabled) interested |= NOTIFY_MARKS | NOTIFY_METADATA;
+	/* FIXME: NOTIFY_METADATA should be checked by the keyword-to-mark functions and converted to NOTIFY_MARKS only if there was a change */
 
-	if (!vf->dir_fd) return;
-
+	if (!(type & interested) || vf->refresh_idle_id != -1 || !vf->dir_fd) return;
+	
 	refresh = (fd == vf->dir_fd);
 
 	if (!refresh)
@@ -837,7 +839,7 @@
 		g_free(base);
 		}
 
-	if (type == NOTIFY_TYPE_CHANGE && fd->change)
+	if ((type & NOTIFY_CHANGE) && fd->change)
 		{
 		if (!refresh && fd->change->dest)
 			{