# HG changeset patch # User nadvornik # Date 1212790263 0 # Node ID 99ea3d973ad3d913611871d1b79085c42d047c9a # Parent 6d65167764ea752db3ffd31eef1b6f4dba1de08b added NotifyType diff -r 6d65167764ea -r 99ea3d973ad3 src/filedata.c --- a/src/filedata.c Fri Jun 06 21:50:09 2008 +0000 +++ b/src/filedata.c Fri Jun 06 22:11:03 2008 +0000 @@ -143,7 +143,7 @@ fd->version++; if (fd->parent) fd->parent->version++; - file_data_send_notification(fd); /* FIXME there are probably situations when we don't want to call this */ + file_data_send_notification(fd, NOTIFY_TYPE_REREAD); /* FIXME there are probably situations when we don't want to call this */ } static void file_data_set_collate_keys(FileData *fd) @@ -1488,14 +1488,14 @@ } -void file_data_send_notification(FileData *fd) +void file_data_send_notification(FileData *fd, NotifyType type) { GList *work = notify_func_list; while(work) { NotifyData *nd = (NotifyData *)work->data; DEBUG_1("Notify func calling: %p %s", nd, fd->path); - nd->func(fd, nd->data); + nd->func(fd, type, nd->data); work = work->next; } } diff -r 6d65167764ea -r 99ea3d973ad3 src/filedata.h --- a/src/filedata.h Fri Jun 06 21:50:09 2008 +0000 +++ b/src/filedata.h Fri Jun 06 22:11:03 2008 +0000 @@ -77,10 +77,10 @@ void file_data_sc_free_ci(FileData *fd); void file_data_sc_free_ci_list(GList *fd_list); -typedef void (*FileDataNotifyFunc)(FileData *fd, gpointer data); +typedef void (*FileDataNotifyFunc)(FileData *fd, NotifyType type, gpointer data); gint file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority); gint file_data_unregister_notify_func(FileDataNotifyFunc func, gpointer data); -void file_data_send_notification(FileData *fd); +void file_data_send_notification(FileData *fd, NotifyType type); gint file_data_register_real_time_monitor(FileData *fd); gint file_data_unregister_real_time_monitor(FileData *fd); diff -r 6d65167764ea -r 99ea3d973ad3 src/typedefs.h --- a/src/typedefs.h Fri Jun 06 21:50:09 2008 +0000 +++ b/src/typedefs.h Fri Jun 06 22:11:03 2008 +0000 @@ -137,6 +137,11 @@ NOTIFY_PRIORITY_LOW } NotifyPriority; +typedef enum { + NOTIFY_TYPE_INTERNAL = 0, /* changed internal data only, like marks */ + NOTIFY_TYPE_REREAD, /* changed file size, date, etc., file name remains unchanged */ + NOTIFY_TYPE_CHANGE /* generic change described by fd->change */ +} NotifyType; #define MAX_SPLIT_IMAGES 4 diff -r 6d65167764ea -r 99ea3d973ad3 src/utilops.c --- a/src/utilops.c Fri Jun 06 21:50:09 2008 +0000 +++ b/src/utilops.c Fri Jun 06 22:11:03 2008 +0000 @@ -279,7 +279,7 @@ /* this is the new way: */ - file_data_send_notification(fd); + file_data_send_notification(fd, NOTIFY_TYPE_CHANGE); } void file_data_sc_notify_ci(FileData *fd) diff -r 6d65167764ea -r 99ea3d973ad3 src/view_file_icon.c --- a/src/view_file_icon.c Fri Jun 06 21:50:09 2008 +0000 +++ b/src/view_file_icon.c Fri Jun 06 22:11:03 2008 +0000 @@ -65,7 +65,7 @@ FileData *fd; }; -static void vficon_notify_cb(FileData *fd, gpointer data); +static void vficon_notify_cb(FileData *fd, NotifyType type, gpointer data); static gint vficon_index_by_id(ViewFile *vf, IconData *in_id); static IconData *vficon_icon_data(ViewFile *vf, FileData *fd) @@ -2557,7 +2557,7 @@ return ret; } -static void vficon_notify_cb(FileData *fd, gpointer data) +static void vficon_notify_cb(FileData *fd, NotifyType type, gpointer data) { ViewFile *vf = data; diff -r 6d65167764ea -r 99ea3d973ad3 src/view_file_list.c --- a/src/view_file_list.c Fri Jun 06 21:50:09 2008 +0000 +++ b/src/view_file_list.c Fri Jun 06 22:11:03 2008 +0000 @@ -50,7 +50,7 @@ static gint vflist_row_is_selected(ViewFile *vf, FileData *fd); static gint vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data); static void vflist_populate_view(ViewFile *vf); -static void vflist_notify_cb(FileData *fd, gpointer data); +static void vflist_notify_cb(FileData *fd, NotifyType type, gpointer data); /* @@ -1875,7 +1875,7 @@ *----------------------------------------------------------------------------- */ -static void vflist_notify_cb(FileData *fd, gpointer data) +static void vflist_notify_cb(FileData *fd, NotifyType type, gpointer data) { ViewFile *vf = data; gboolean refresh;