From 50556ee0a55da7eaac93966961a56416a6cbd64c Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Thu, 20 Mar 2008 09:40:28 +0000 Subject: [PATCH] Fixed FEN does not emit attribute changed events when optimizing changed 2008-03-20 Lin Ma * fen/fen-data.c: (process_events), (fdata_add_event): Fixed FEN does not emit attribute changed events when optimizing changed events. * fen/fen-helper.c, fen/fen-kernel.c: Added ifdef to default disable warning messages. svn path=/trunk/; revision=6743 --- gio/ChangeLog | 7 +++++++ gio/fen/fen-data.c | 20 ++++++++++++++++---- gio/fen/fen-helper.c | 4 ++++ gio/fen/fen-kernel.c | 4 ++++ 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index f90babf42..c842372c6 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2008-03-20 Lin Ma + + * fen/fen-data.c: (process_events), (fdata_add_event): Fixed FEN does + not emit attribute changed events when optimizing changed events. + * fen/fen-helper.c, fen/fen-kernel.c: Added ifdef to default disable + warning messages. + 2008-03-19 Matthias Clasen * gmountoperation.[hc]: Small documentation additions diff --git a/gio/fen/fen-data.c b/gio/fen/fen-data.c index a094add5f..68db1181d 100644 --- a/gio/fen/fen-data.c +++ b/gio/fen/fen-data.c @@ -43,7 +43,11 @@ #define BASE_NUM 2 #define FD_W if (fd_debug_enabled) g_warning +#ifdef GIO_COMPILATION static gboolean fd_debug_enabled = FALSE; +#else +static gboolean fd_debug_enabled = TRUE; +#endif G_LOCK_EXTERN (fen_lock); static GList *deleting_data = NULL; @@ -557,8 +561,16 @@ process_events (gpointer udata) g_assert (f->change_update_id > 0); } break; - case FILE_ATTRIB: /* Ignored */ - case FILE_DELETE: + case FILE_ATTRIB: + g_assert (f->change_update_id == 0); + if (!port_add (&f->fobj, &f->len, f)) { + ev = fnode_event_new (FILE_DELETE, FALSE, f); + if (ev != NULL) { + fdata_add_event (f, ev); + } + } + break; + case FILE_DELETE: /* Ignored */ break; default: g_assert_not_reached (); @@ -651,10 +663,10 @@ fdata_add_event (fdata *f, fnode_event_t *ev) } else { break; } - } else if (tail->e == FILE_ATTRIB && ev->e == FILE_MODIFIED) { + } else if (ev->e == FILE_MODIFIED && tail->e == FILE_ATTRIB) { ev->has_twin = TRUE; fnode_event_delete (tail); - } else if (ev->e == FILE_ATTRIB) { + } else if (ev->e == FILE_ATTRIB && f->change_update_id > 0) { tail->has_twin = TRUE; /* skip the current event */ fnode_event_delete (ev); diff --git a/gio/fen/fen-helper.c b/gio/fen/fen-helper.c index 381dd5239..6d304acd3 100644 --- a/gio/fen/fen-helper.c +++ b/gio/fen/fen-helper.c @@ -35,7 +35,11 @@ #endif #define FH_W if (fh_debug_enabled) g_warning +#ifdef GIO_COMPILATION static gboolean fh_debug_enabled = FALSE; +#else +static gboolean fh_debug_enabled = TRUE; +#endif G_LOCK_EXTERN (fen_lock); diff --git a/gio/fen/fen-kernel.c b/gio/fen/fen-kernel.c index cdcecc141..d9531daf7 100644 --- a/gio/fen/fen-kernel.c +++ b/gio/fen/fen-kernel.c @@ -33,7 +33,11 @@ #include "fen-dump.h" #define FK_W if (fk_debug_enabled) g_warning +#ifdef GIO_COMPILATION static gboolean fk_debug_enabled = FALSE; +#else +static gboolean fk_debug_enabled = TRUE; +#endif G_GNUC_INTERNAL G_LOCK_DEFINE (fen_lock); #define PE_ALLOC 64 -- 2.34.1