static void dupe_dnd_init(DupeWindow *dw);
+static void dupe_notify_cb(FileData *fd, NotifyType type, gpointer data);
+
/*
* ------------------------------------------------------------------
* Window updates
dupe_list_free(dw->second_list);
+ file_data_unregister_notify_func(dupe_notify_cb, dw);
+
g_free(dw);
}
dupe_window_list = g_list_append(dupe_window_list, dw);
+ file_data_register_notify_func(dupe_notify_cb, dw, NOTIFY_PRIORITY_MEDIUM);
+
return dw;
}
*-------------------------------------------------------------------
*/
-void dupe_maint_removed(FileData *fd)
-{
- GList *work;
-
- work = dupe_window_list;
- while (work)
- {
- DupeWindow *dw = work->data;
- work = work->next;
-
- while (dupe_item_remove_by_path(dw, fd->path));
- }
-}
-
-void dupe_maint_renamed(FileData *fd)
+static void dupe_notify_cb(FileData *fd, NotifyType type, gpointer data)
{
- GList *work;
+ DupeWindow *dw = data;
- work = dupe_window_list;
- while (work)
+ if (!fd->change) return;
+
+ switch(fd->change->type)
{
- DupeWindow *dw = work->data;
- work = work->next;
-
- dupe_item_update_fd(dw, fd);
+ case FILEDATA_CHANGE_MOVE:
+ case FILEDATA_CHANGE_RENAME:
+ dupe_item_update_fd(dw, fd);
+ break;
+ case FILEDATA_CHANGE_COPY:
+ break;
+ case FILEDATA_CHANGE_DELETE:
+ while (dupe_item_remove_by_path(dw, fd->path));
+ break;
+ case FILEDATA_CHANGE_UNSPECIFIED:
+ break;
}
}
void dupe_window_add_collection(DupeWindow *dw, CollectionData *collection);
void dupe_window_add_files(DupeWindow *dw, GList *list, gint recurse);
-void dupe_maint_removed(FileData *fd);
-void dupe_maint_renamed(FileData *fd);
-
-
/* cell max with/height hack utility */
void cell_renderer_height_override(GtkCellRenderer *renderer);
layout_maint_moved(fd, NULL);
view_window_maint_moved(fd);
- dupe_maint_renamed(fd);
search_maint_renamed(fd);
break;
case FILEDATA_CHANGE_COPY:
layout_maint_renamed(fd);
view_window_maint_moved(fd);
- dupe_maint_renamed(fd);
search_maint_renamed(fd);
break;
case FILEDATA_CHANGE_DELETE:
layout_maint_removed(fd, NULL);
view_window_maint_removed(fd, NULL);
- dupe_maint_removed(fd);
search_maint_removed(fd);
collection_maint_removed(fd);