added NotifyType
authorVladimir Nadvornik <nadvornik@suse.cz>
Fri, 6 Jun 2008 22:11:03 +0000 (22:11 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Fri, 6 Jun 2008 22:11:03 +0000 (22:11 +0000)
src/filedata.c
src/filedata.h
src/typedefs.h
src/utilops.c
src/view_file_icon.c
src/view_file_list.c

index 84d8cfb..ae0bac6 100644 (file)
@@ -143,7 +143,7 @@ void file_data_increment_version(FileData *fd)
        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 @@ 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)
 {
        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;
                }
 }
index ece237e..8b9988b 100644 (file)
@@ -77,10 +77,10 @@ gint file_data_sc_apply_ci(FileData *fd);
 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);
index a848978..5f4afc2 100644 (file)
@@ -137,6 +137,11 @@ typedef enum {
        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
index b86dba2..5cc662e 100644 (file)
@@ -279,7 +279,7 @@ void file_data_notify_ci(FileData *fd)
 
 
        /* 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)
index 3921886..7d1f84e 100644 (file)
@@ -65,7 +65,7 @@ struct _IconData
        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 @@ static gint vficon_maint_moved(ViewFile *vf, FileData *fd, GList *ignore_list)
        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;
 
index 90e464e..266c057 100644 (file)
@@ -50,7 +50,7 @@ enum {
 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 @@ void vflist_marks_set(ViewFile *vf, gint enable)
  *-----------------------------------------------------------------------------
  */
 
-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;