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)
}
-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;
}
}
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);
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
/* 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)
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)
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;
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);
/*
*-----------------------------------------------------------------------------
*/
-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;