return id;
}
-
+#if 0
+/* not used */
static gint iconlist_read(FileData *dir_fd, GList **list)
{
GList *temp;
return TRUE;
}
+#endif
static void iconlist_free(GList *list)
{
vficon_update_focus(vf);
}
-static gint vficon_sync_idle_cb(gpointer data)
+static gint vficon_refresh_idle_cb(gpointer data)
{
ViewFile *vf = data;
- if (VFICON_INFO(vf, sync_idle_id) == -1) return FALSE;
- VFICON_INFO(vf, sync_idle_id) = -1;
-
- vficon_sync(vf);
+ 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)
{
if (VFICON_INFO(vf, sync_idle_id) == -1)
VFICON_INFO(vf, sync_idle_id) = g_idle_add_full(G_PRIORITY_HIGH, vficon_sync_idle_cb, vf, NULL);
}
}
+#endif
static void vficon_sized_cb(GtkWidget *widget, GtkAllocation *allocation, gpointer data)
{
{
ViewFile *vf = data;
- if (VFICON_INFO(vf, sync_idle_id) != -1) g_source_remove(VFICON_INFO(vf, sync_idle_id));
+ vficon_refresh_idle_cancel(vf);
file_data_unregister_notify_func(vficon_notify_cb, vf);
VFICON_INFO(vf, show_text) = options->show_icon_names;
- VFICON_INFO(vf, sync_idle_id) = -1;
+ 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));
*-----------------------------------------------------------------------------
*/
+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;
}
}
+#endif