moved notification to view_file.c
authorVladimir Nadvornik <nadvornik@suse.cz>
Mon, 9 Jun 2008 20:27:39 +0000 (20:27 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Mon, 9 Jun 2008 20:27:39 +0000 (20:27 +0000)
src/view_file.c
src/view_file.h
src/view_file_icon.c
src/view_file_list.c

index 294c59a..2980b30 100644 (file)
@@ -17,6 +17,7 @@
 #include "layout.h"
 #include "menu.h"
 #include "ui_menu.h"
+#include "ui_fileops.h"
 #include "utilops.h"
 #include "view_file_list.h"
 #include "view_file_icon.h"
@@ -676,6 +677,8 @@ ViewFile *vf_new(FileViewType type, FileData *dir_fd)
 
        vf->popup = NULL;
 
+       vf->refresh_idle_id = -1;
+
        vf->widget = gtk_scrolled_window_new(NULL, NULL);
        gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(vf->widget), GTK_SHADOW_IN);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vf->widget),
@@ -742,50 +745,65 @@ void vf_set_layout(ViewFile *vf, LayoutWindow *layout)
        vf->layout = layout;
 }
 
-#if 0
+
 /*
  *-----------------------------------------------------------------------------
  * maintenance (for rename, move, remove)
  *-----------------------------------------------------------------------------
  */
-
-
-gint vf_maint_renamed(ViewFile *vf, FileData *fd)
+static gint vf_refresh_idle_cb(gpointer data)
 {
-       gint ret = FALSE;
-
-       switch(vf->type)
-       {
-//     case FILEVIEW_LIST: ret = vflist_maint_renamed(vf, fd); break;
-       case FILEVIEW_ICON: ret = vficon_maint_renamed(vf, fd); break;
-       }
+       ViewFile *vf = data;
 
-       return ret;
+       vf_refresh(vf);
+       vf->refresh_idle_id = -1;
+       return FALSE;
 }
 
-gint vf_maint_removed(ViewFile *vf, FileData *fd, GList *ignore_list)
+void vf_refresh_idle_cancel(ViewFile *vf)
 {
-       gint ret = FALSE;
-
-       switch(vf->type)
-       {
-//     case FILEVIEW_LIST: ret = vflist_maint_removed(vf, fd, ignore_list); break;
-       case FILEVIEW_ICON: ret = vficon_maint_removed(vf, fd, ignore_list); break;
-       }
-
-       return ret;
+       if (vf->refresh_idle_id != -1) g_source_remove(vf->refresh_idle_id);
+       vf->refresh_idle_id = -1;
 }
 
-gint vf_maint_moved(ViewFile *vf, FileData *fd, GList *ignore_list)
+
+void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
-       gint ret = FALSE;
+       ViewFile *vf = data;
+       gboolean refresh;
 
-       switch(vf->type)
-       {
-//     case FILEVIEW_LIST: ret = vflist_maint_moved(vf, fd, ignore_list); break;
-       case FILEVIEW_ICON: ret = vficon_maint_moved(vf, fd, ignore_list); break;
-       }
+       if (vf->refresh_idle_id != -1) return;
+       
+       refresh = (fd == vf->dir_fd);
 
-       return ret;
+       if (!refresh)
+               {
+               gchar *base = remove_level_from_path(fd->path);
+               refresh = (strcmp(base, vf->dir_fd->path) == 0);
+               g_free(base);
+               }
+
+       if (type == NOTIFY_TYPE_CHANGE && fd->change)
+               {
+               if (!refresh && fd->change->dest)
+                       {
+                       gchar *dest_base = remove_level_from_path(fd->change->dest);
+                       refresh = (strcmp(dest_base, vf->dir_fd->path) == 0);
+                       g_free(dest_base);
+                       }
+
+               if (!refresh && fd->change->source)
+                       {
+                       gchar *source_base = remove_level_from_path(fd->change->source);
+                       refresh = (strcmp(source_base, vf->dir_fd->path) == 0);
+                       g_free(source_base);
+                       }
+               }
+       
+       if (refresh && vf->refresh_idle_id == -1)
+               {
+               vf->refresh_idle_id = g_idle_add(vf_refresh_idle_cb, vf);
+               }
 }
-#endif
+
index 0213386..83b08f6 100644 (file)
@@ -61,4 +61,6 @@ void vf_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode);
 void vf_select_marked(ViewFile *vf, gint mark);
 void vf_mark_selected(ViewFile *vf, gint mark, gint value);
 
+void vf_refresh_idle_cancel(ViewFile *vf);
+void vf_notify_cb(FileData *fd, NotifyType type, gpointer data);
 #endif /* VIEW_FILE_H */
index b07dc1d..10a720b 100644 (file)
@@ -65,7 +65,6 @@ struct _IconData
        FileData *fd;
 };
 
-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)
@@ -1750,21 +1749,6 @@ static void vficon_sync(ViewFile *vf)
        vficon_update_focus(vf);
 }
 
-static gint vficon_refresh_idle_cb(gpointer data)
-{
-       ViewFile *vf = data;
-
-       vficon_refresh(vf);
-       vf->refresh_idle_id = -1;
-       return FALSE;
-}
-
-static void vficon_refresh_idle_cancel(ViewFile *vf)
-{
-       if (vf->refresh_idle_id != -1) g_source_remove(vf->refresh_idle_id);
-       vf->refresh_idle_id = -1;
-}
-
 #if 0
 static void vficon_sync_idle(ViewFile *vf)
 {
@@ -2341,9 +2325,9 @@ void vficon_destroy_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf = data;
 
-       vficon_refresh_idle_cancel(vf);
+       vf_refresh_idle_cancel(vf);
        
-       file_data_unregister_notify_func(vficon_notify_cb, vf);
+       file_data_unregister_notify_func(vf_notify_cb, vf);
 
        tip_unschedule(vf);
 
@@ -2373,8 +2357,6 @@ ViewFile *vficon_new(ViewFile *vf, FileData *dir_fd)
 
        VFICON_INFO(vf, show_text) = options->show_icon_names;
 
-       vf->refresh_idle_id = -1;
-
        store = gtk_list_store_new(1, G_TYPE_POINTER);
        vf->listview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
        g_object_unref(store);
@@ -2409,325 +2391,8 @@ ViewFile *vficon_new(ViewFile *vf, FileData *dir_fd)
        /* force VFICON_INFO(vf, columns) to be at least 1 (sane) - this will be corrected in the size_cb */
        vficon_populate_at_new_size(vf, 1, 1, FALSE);
 
-       file_data_register_notify_func(vficon_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
+       file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
 
        return vf;
 }
 
-/*
- *-----------------------------------------------------------------------------
- * maintenance (for rename, move, remove)
- *-----------------------------------------------------------------------------
- */
-
-static void vficon_notify_cb(FileData *fd, NotifyType type, gpointer data)
-{
-       ViewFile *vf = data;
-       gboolean refresh;
-
-       if (vf->refresh_idle_id != -1) return;
-       
-       refresh = (fd == vf->dir_fd);
-
-       if (!refresh)
-               {
-               gchar *base = remove_level_from_path(fd->path);
-               refresh = (strcmp(base, vf->dir_fd->path) == 0);
-               g_free(base);
-               }
-
-       if (type == NOTIFY_TYPE_CHANGE && fd->change)
-               {
-               if (!refresh && fd->change->dest)
-                       {
-                       gchar *dest_base = remove_level_from_path(fd->change->dest);
-                       refresh = (strcmp(dest_base, vf->dir_fd->path) == 0);
-                       g_free(dest_base);
-                       }
-
-               if (!refresh && fd->change->source)
-                       {
-                       gchar *source_base = remove_level_from_path(fd->change->source);
-                       refresh = (strcmp(source_base, vf->dir_fd->path) == 0);
-                       g_free(source_base);
-                       }
-               }
-       
-       if (refresh && vf->refresh_idle_id == -1)
-               {
-               vf->refresh_idle_id = g_idle_add(vficon_refresh_idle_cb, vf);
-               }
-}
-
-
-#if 0
-static gint vficon_maint_find_closest(ViewFile *vf, gint row, gint count, GList *ignore_list)
-{
-       GList *list = NULL;
-       GList *work;
-       gint rev = row - 1;
-       
-       row++;
-
-       work = ignore_list;
-       while (work)
-               {
-               FileData *fd = work->data;
-               gint f = vficon_index_by_fd(vf, fd);
-               g_assert(fd->magick == 0x12345678);
-
-               if (f >= 0) list = g_list_prepend(list, GINT_TO_POINTER(f));
-               work = work->next;
-               }
-
-       while (list)
-               {
-               gint c = TRUE;
-
-               work = list;
-               while (work && c)
-                       {
-                       gpointer p = work->data;
-
-                       work = work->next;
-                       if (row == GPOINTER_TO_INT(p))
-                               {
-                               row++;
-                               c = FALSE;
-                               }
-                       if (rev == GPOINTER_TO_INT(p))
-                               {
-                               rev--;
-                               c = FALSE;
-                               }
-                       if (!c) list = g_list_remove(list, p);
-                       }
-
-               if (c && list)
-                       {
-                       g_list_free(list);
-                       list = NULL;
-                       }
-               }
-
-       if (row > count - 1)
-               {
-               if (rev < 0)
-                       return -1;
-               else
-                       return rev;
-               }
-       else
-               {
-               return row;
-               }
-}
-
-static gint vficon_maint_removed(ViewFile *vf, FileData *fd, GList *ignore_list);
-
-
-static gint vficon_maint_renamed(ViewFile *vf, FileData *fd)
-{
-       gint ret = FALSE;
-       gint row;
-       gchar *source_base;
-       gchar *dest_base;
-       IconData *id = vficon_icon_data(vf, fd);
-
-       if (!id) return FALSE;
-
-       row = vficon_index_by_id(vf, id);
-       if (row < 0) return FALSE;
-
-       source_base = remove_level_from_path(fd->change->source);
-       dest_base = remove_level_from_path(fd->change->dest);
-
-       if (strcmp(source_base, dest_base) == 0)
-               {
-               vf->list = g_list_remove(vf->list, id);
-               vf->list = iconlist_insert_sort(vf->list, id, vf->sort_method, vf->sort_ascend);
-
-               vficon_sync_idle(vf);
-               ret = TRUE;
-               }
-       else
-               {
-               ret = vficon_maint_removed(vf, fd, NULL);
-               }
-
-       g_free(source_base);
-       g_free(dest_base);
-
-       return ret;
-}
-
-static gint vficon_maint_removed(ViewFile *vf, FileData *fd, GList *ignore_list)
-{
-       gint row;
-       gint new_row = -1;
-       GtkTreeModel *store;
-       GtkTreeIter iter;
-       IconData *id = vficon_icon_data(vf, fd);
-
-       if (!id) return FALSE;
-
-       row = g_list_index(vf->list, id);
-       if (row < 0) return FALSE;
-
-       if ((id->selected & SELECTION_SELECTED) &&
-           layout_image_get_collection(vf->layout, NULL) == NULL)
-               {
-               vficon_unselect(vf, id);
-
-               if (!VFICON_INFO(vf, selection))
-                       {
-                       gint n;
-
-                       n = vf_count(vf, NULL);
-                       if (ignore_list)
-                               {
-                               new_row = vficon_maint_find_closest(vf, row, n, ignore_list);
-                               DEBUG_1("row = %d, closest is %d", row, new_row);
-                               }
-                       else
-                               {
-                               if (row + 1 < n)
-                                       {
-                                       new_row = row + 1;
-                                       }
-                               else if (row > 0)
-                                       {
-                                       new_row = row - 1;
-                                       }
-                               }
-                       }
-               else if (ignore_list)
-                       {
-                       GList *work;
-
-                       work = VFICON_INFO(vf, selection);
-                       while (work)
-                               {
-                               IconData *ignore_id;
-                               FileData *ignore_fd;
-                               GList *tmp;
-                               gint match = FALSE;
-
-                               ignore_id = work->data;
-                               ignore_fd = ignore_id->fd;
-                               g_assert(ignore_fd->magick == 0x12345678);
-                               work = work->next;
-
-                               tmp = ignore_list;
-                               while (tmp && !match)
-                                       {
-                                       FileData *ignore_list_fd = tmp->data;
-                                       g_assert(ignore_list_fd->magick == 0x12345678);
-                                       tmp = tmp->next;
-
-                                       if (ignore_list_fd == ignore_fd)
-                                               {
-                                               match = TRUE;
-                                               }
-                                       }
-
-                               if (!match)
-                                       {
-                                       new_row = g_list_index(vf->list, ignore_id);
-                                       work = NULL;
-                                       }
-                               }
-
-                       if (new_row == -1)
-                               {
-                               /* selection all ignored, use closest */
-                               new_row = vficon_maint_find_closest(vf, row, vf_count(vf, NULL), ignore_list);
-                               }
-                       }
-               else
-                       {
-                       new_row = g_list_index(vf->list, VFICON_INFO(vf, selection)->data);
-                       }
-
-               if (new_row >= 0)
-                       {
-                       IconData *idn = g_list_nth_data(vf->list, new_row);
-
-                       vficon_select(vf, idn);
-                       vficon_send_layout_select(vf, idn);
-                       }
-               }
-
-       /* Thumb loader check */
-       if (fd == vf->thumbs_filedata) vf->thumbs_filedata = NULL;
-       if (vf->thumbs_count > 0) vf->thumbs_count--;
-
-       if (VFICON_INFO(vf, prev_selection) == id) VFICON_INFO(vf, prev_selection) = NULL;
-       if (VFICON_INFO(vf, click_id) == id) VFICON_INFO(vf, click_id) = NULL;
-
-       /* remove pointer to this fd from grid */
-       store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
-       if (id->row >= 0 &&
-           gtk_tree_model_iter_nth_child(store, &iter, NULL, id->row))
-               {
-               GList *list;
-
-               gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &list, -1);
-               list = g_list_find(list, id);
-               if (list) list->data = NULL;
-               }
-
-       vf->list = g_list_remove(vf->list, id);
-       file_data_unref(fd);
-       g_free(id);
-
-       vficon_sync_idle(vf);
-       vf_send_update(vf);
-
-       return TRUE;
-}
-
-static gint vficon_maint_moved(ViewFile *vf, FileData *fd, GList *ignore_list)
-{
-       gint ret = FALSE;
-       gchar *buf;
-
-       if (!fd->change->source || !vf->dir_fd) return FALSE;
-
-       buf = remove_level_from_path(fd->change->source);
-
-       if (strcmp(buf, vf->dir_fd->path) == 0)
-               {
-               ret = vficon_maint_removed(vf, fd, ignore_list);
-               }
-
-       g_free(buf);
-
-       return ret;
-}
-
-static void vficon_notify_cb(FileData *fd, NotifyType type, gpointer data)
-{
-       ViewFile *vf = data;
-
-       if (type != NOTIFY_TYPE_CHANGE || !fd->change) return;
-       
-       switch(fd->change->type)
-               {
-               case FILEDATA_CHANGE_MOVE:
-                       vficon_maint_moved(vf, fd, NULL);
-                       break;
-               case FILEDATA_CHANGE_COPY:
-                       break;
-               case FILEDATA_CHANGE_RENAME:
-                       vficon_maint_renamed(vf, fd);
-                       break;
-               case FILEDATA_CHANGE_DELETE:
-                       vficon_maint_removed(vf, fd, NULL);
-                       break;
-               case FILEDATA_CHANGE_UNSPECIFIED:
-                       break;
-               }
-
-}
-#endif
index 3015ada..641f020 100644 (file)
@@ -50,7 +50,6 @@ 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, NotifyType type, gpointer data);
 
 
 /*
@@ -1471,7 +1470,7 @@ void vflist_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)
                gtk_tree_model_get_iter(store, &iter, tpath);
                gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd, -1);
 
-               file_data_unregister_notify_func(vflist_notify_cb, vf); /* we don't need the notification */
+               file_data_unregister_notify_func(vf_notify_cb, vf); /* we don't need the notification */
 
                switch (mode)
                        {
@@ -1483,7 +1482,7 @@ void vflist_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)
                                break;
                        }
                
-               file_data_register_notify_func(vflist_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
+               file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
 
                gtk_tree_store_set(GTK_TREE_STORE(store), &iter, FILE_COLUMN_MARKS + n, file_data_get_mark(fd, n), -1);
 
@@ -1588,11 +1587,11 @@ gint vflist_refresh(ViewFile *vf)
        DEBUG_1("%s vflist_refresh: read dir", get_exec_time());
        if (vf->dir_fd)
                {
-               file_data_unregister_notify_func(vflist_notify_cb, vf); /* we don't need the notification of changes detected by filelist_read */
+               file_data_unregister_notify_func(vf_notify_cb, vf); /* we don't need the notification of changes detected by filelist_read */
 
                ret = filelist_read(vf->dir_fd, &vf->list, NULL);
 
-               file_data_register_notify_func(vflist_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
+               file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
 
                DEBUG_1("%s vflist_refresh: sort", get_exec_time());
                vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend);
@@ -1608,20 +1607,6 @@ gint vflist_refresh(ViewFile *vf)
        return ret;
 }
 
-static gint vflist_refresh_idle_cb(gpointer data)
-{
-       ViewFile *vf = data;
-
-       vflist_refresh(vf);
-       vf->refresh_idle_id = -1;
-       return FALSE;
-}
-
-static void vflist_refresh_idle_cancel(ViewFile *vf)
-{
-       if (vf->refresh_idle_id != -1) g_source_remove(vf->refresh_idle_id);
-       vf->refresh_idle_id = -1;
-}
 
 
 /* this overrides the low default of a GtkCellRenderer from 100 to CELL_HEIGHT_OVERRIDE, something sane for our purposes */
@@ -1730,9 +1715,9 @@ static void vflist_listview_mark_toggled_cb(GtkCellRendererToggle *cell, gchar *
 
        gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, FILE_COLUMN_POINTER, &fd, col_idx, &mark, -1);
        mark = !mark;
-       file_data_unregister_notify_func(vflist_notify_cb, vf); /* we don't need the notification */
+       file_data_unregister_notify_func(vf_notify_cb, vf); /* we don't need the notification */
        file_data_set_mark(fd, col_idx - FILE_COLUMN_MARKS, mark);
-       file_data_register_notify_func(vflist_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
+       file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
 
        gtk_tree_store_set(store, &iter, col_idx, mark, -1);
        gtk_tree_path_free(path);
@@ -1789,10 +1774,10 @@ void vflist_destroy_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf = data;
 
-       file_data_unregister_notify_func(vflist_notify_cb, vf);
+       file_data_unregister_notify_func(vf_notify_cb, vf);
 
        vflist_select_idle_cancel(vf);
-       vflist_refresh_idle_cancel(vf);
+       vf_refresh_idle_cancel(vf);
        vflist_thumb_stop(vf);
 
        filelist_free(vf->list);
@@ -1813,8 +1798,6 @@ ViewFile *vflist_new(ViewFile *vf, FileData *dir_fd)
        VFLIST_INFO(vf, thumbs_enabled) = FALSE;
 
        VFLIST_INFO(vf, select_idle_id) = -1;
-       vf->refresh_idle_id = -1;
-
 
        flist_types[FILE_COLUMN_POINTER] = G_TYPE_POINTER;
        flist_types[FILE_COLUMN_VERSION] = G_TYPE_INT;
@@ -1850,7 +1833,7 @@ ViewFile *vflist_new(ViewFile *vf, FileData *dir_fd)
        vflist_listview_add_column(vf, FILE_COLUMN_SIZE, _("Size"), FALSE, TRUE, FALSE);
        vflist_listview_add_column(vf, FILE_COLUMN_DATE, _("Date"), FALSE, TRUE, FALSE);
 
-       file_data_register_notify_func(vflist_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
+       file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
        return vf;
 }
 
@@ -1887,272 +1870,3 @@ void vflist_marks_set(ViewFile *vf, gint enable)
        //vf_refresh(vf);
 }
 
-/*
- *-----------------------------------------------------------------------------
- * maintenance (for rename, move, remove)
- *-----------------------------------------------------------------------------
- */
-
-static void vflist_notify_cb(FileData *fd, NotifyType type, gpointer data)
-{
-       ViewFile *vf = data;
-       gboolean refresh;
-
-       if (vf->refresh_idle_id != -1) return;
-       
-       refresh = (fd == vf->dir_fd);
-
-       if (!refresh)
-               {
-               gchar *base = remove_level_from_path(fd->path);
-               refresh = (strcmp(base, vf->dir_fd->path) == 0);
-               g_free(base);
-               }
-
-       if (type == NOTIFY_TYPE_CHANGE && fd->change)
-               {
-               if (!refresh && fd->change->dest)
-                       {
-                       gchar *dest_base = remove_level_from_path(fd->change->dest);
-                       refresh = (strcmp(dest_base, vf->dir_fd->path) == 0);
-                       g_free(dest_base);
-                       }
-
-               if (!refresh && fd->change->source)
-                       {
-                       gchar *source_base = remove_level_from_path(fd->change->source);
-                       refresh = (strcmp(source_base, vf->dir_fd->path) == 0);
-                       g_free(source_base);
-                       }
-               }
-       
-       if (refresh && vf->refresh_idle_id == -1)
-               {
-               vf->refresh_idle_id = g_idle_add(vflist_refresh_idle_cb, vf);
-               }
-}
-
-#if 0
-
-gint vflist_maint_renamed(ViewFile *vf, FileData *fd)
-{
-       vflist_maint(vf, fd);
-       return TRUE;
-}
-gint vflist_maint_removed(ViewFile *vf, FileData *fd, GList *ignore_list)
-{
-       vflist_maint(vf, fd);
-       return TRUE;
-}
-gint vflist_maint_moved(ViewFile *vf, FileData *fd, GList *ignore_list)
-{
-       vflist_maint(vf, fd);
-       return TRUE;
-}
-
-
-static gint vflist_maint_find_closest(ViewFile *vf, gint row, gint count, GList *ignore_list)
-{
-       GList *list = NULL;
-       GList *work;
-       gint rev = row - 1;
-       row ++;
-
-       work = ignore_list;
-       while (work)
-               {
-               gint f = vf_index_by_path(vf, work->data);
-               if (f >= 0) list = g_list_prepend(list, GINT_TO_POINTER(f));
-               work = work->next;
-               }
-
-       while (list)
-               {
-               gint c = TRUE;
-               work = list;
-               while (work && c)
-                       {
-                       gpointer p = work->data;
-                       work = work->next;
-                       if (row == GPOINTER_TO_INT(p))
-                               {
-                               row++;
-                               c = FALSE;
-                               }
-                       if (rev == GPOINTER_TO_INT(p))
-                               {
-                               rev--;
-                               c = FALSE;
-                               }
-                       if (!c) list = g_list_remove(list, p);
-                       }
-               if (c && list)
-                       {
-                       g_list_free(list);
-                       list = NULL;
-                       }
-               }
-       if (row > count - 1)
-               {
-               if (rev < 0)
-                       return -1;
-               else
-                       return rev;
-               }
-       else
-               {
-               return row;
-               }
-}
-
-gint vflist_maint_renamed(ViewFile *vf, FileData *fd)
-{
-       gint ret = FALSE;
-       gchar *source_base;
-       gchar *dest_base;
-
-       DEBUG_1("%s vflist_maint_renamed: start", get_exec_time());
-
-       if (g_list_index(vf->list, fd) < 0) return FALSE;
-
-       source_base = remove_level_from_path(fd->change->source);
-       dest_base = remove_level_from_path(fd->change->dest);
-
-
-       if (strcmp(source_base, dest_base) == 0)
-               {
-               GtkTreeStore *store;
-               GtkTreeIter iter;
-               GtkTreeIter position;
-               gint old_row;
-               gint n;
-
-               old_row = g_list_index(vf->list, fd);
-
-               vf->list = g_list_remove(vf->list, fd);
-
-               vf->list = filelist_insert_sort(vf->list, fd, vf->sort_method, vf->sort_ascend);
-               n = g_list_index(vf->list, fd);
-
-               store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)));
-               if (vflist_find_row(vf, fd, &iter) >= 0 &&
-                   gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &position, NULL, n))
-                       {
-                       if (old_row >= n)
-                               {
-                               gtk_tree_store_move_before(store, &iter, &position);
-                               }
-                       else
-                               {
-                               gtk_tree_store_move_after(store, &iter, &position);
-                               }
-                       }
-               gtk_tree_store_set(store, &iter, FILE_COLUMN_NAME, fd->name, -1);
-
-               ret = TRUE;
-               }
-       else
-               {
-               ret = vflist_maint_removed(vf, fd, NULL);
-               }
-
-       g_free(source_base);
-       g_free(dest_base);
-
-       DEBUG_1("%s vflist_maint_renamed: done", get_exec_time());
-
-       return ret;
-}
-
-gint vflist_maint_removed(ViewFile *vf, FileData *fd, GList *ignore_list)
-{
-       GtkTreeIter iter;
-       GList *list;
-       gint row;
-       gint new_row = -1;
-
-       DEBUG_1("%s vflist_maint_removed: start", get_exec_time());
-
-       row = g_list_index(vf->list, fd);
-       if (row < 0) return FALSE;
-
-       if (vflist_index_is_selected(vf, row) &&
-           layout_image_get_collection(vf->layout, NULL) == NULL)
-               {
-               gint n;
-
-               n = vf_count(vf, NULL);
-               if (ignore_list)
-                       {
-                       new_row = vflist_maint_find_closest(vf, row, n, ignore_list);
-                       DEBUG_1("row = %d, closest is %d", row, new_row);
-                       }
-               else
-                       {
-                       if (row + 1 < n)
-                               {
-                               new_row = row + 1;
-                               }
-                       else if (row > 0)
-                               {
-                               new_row = row - 1;
-                               }
-                       }
-               vf_select_none(vf);
-               if (new_row >= 0)
-                       {
-                       fd = vf_index_get_data(vf, new_row);
-                       if (vflist_find_row(vf, fd, &iter) >= 0)
-                               {
-                               GtkTreeSelection *selection;
-
-                               selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(vf->listview));
-                               gtk_tree_selection_select_iter(selection, &iter);
-                               vflist_move_cursor(vf, &iter);
-                               }
-                       }
-               }
-
-       fd = vf_index_get_data(vf, row);
-       if (vflist_find_row(vf, fd, &iter) >= 0)
-               {
-               GtkTreeStore *store;
-               store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)));
-               gtk_tree_store_remove(store, &iter);
-               }
-       list = g_list_nth(vf->list, row);
-       fd = list->data;
-
-       /* thumbnail loader check */
-       if (fd == vf->thumbs_filedata) vf->thumbs_filedata = NULL;
-       if (vf->thumbs_count > 0) vf->thumbs_count--;
-
-       vf->list = g_list_remove(vf->list, fd);
-       file_data_unref(fd);
-
-       vf_send_update(vf);
-
-       DEBUG_1("%s vflist_maint_removed: done", get_exec_time());
-
-       return TRUE;
-}
-
-gint vflist_maint_moved(ViewFile *vf, FileData *fd, GList *ignore_list)
-{
-       gint ret = FALSE;
-       gchar *buf;
-
-       if (!fd->change->source || !vf->path) return FALSE;
-
-       buf = remove_level_from_path(fd->change->source);
-
-       if (strcmp(buf, vf->path) == 0)
-               {
-               ret = vflist_maint_removed(vf, fd, ignore_list);
-               }
-
-       g_free(buf);
-
-       return ret;
-}
-#endif