/*
* Geeqie
* (C) 2004 John Ellis
- * Copyright (C) 2008 - 2010 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Author: John Ellis
*
{
FileData *fd;
gtk_tree_model_get(model, iter, FILE_COLUMN_POINTER, &fd, -1);
+
+ /* it seems that gtk_tree_store_clear may call some callbacks
+ that use the column. Set the pointer to NULL to be safe. */
+ gtk_tree_store_set(GTK_TREE_STORE(model), iter, FILE_COLUMN_POINTER, NULL, -1);
file_data_unref(fd);
return FALSE;
}
{
ViewFile *vf = data;
GList *list = NULL;
- gchar *uri_text = NULL;
- gint total;
if (!VFLIST(vf)->click_fd) return;
}
if (!list) return;
-
- uri_text = uri_text_from_filelist(list, &total, (info == TARGET_TEXT_PLAIN));
+ uri_selection_data_set_uris_from_filelist(selection_data, list);
filelist_free(list);
-
- DEBUG_1("%s", uri_text);
-
- gtk_selection_data_set(selection_data, selection_data->target,
- 8, (guchar *)uri_text, total);
- g_free(uri_text);
}
static void vflist_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
- if (context->action == GDK_ACTION_MOVE)
+ if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
vf_refresh(vf);
}
if (fd) {
/* Add keywords to file */
- gchar *str = g_strndup((gchar *)selection->data, selection->length);
+ gchar *str = gtk_selection_data_get_text(selection);
GList *kw_list = string_to_keywords_list(str);
metadata_append_list(fd, KEYWORD_KEY, kw_list);
else
{
gchar *old_path = g_build_filename(vf->dir_fd->path, old, NULL);
- FileData *fd = file_data_new_simple(old_path); /* get the fd from cache */
+ FileData *fd = file_data_new_group(old_path); /* get the fd from cache */
file_util_rename_simple(fd, new_path, vf->listview);
file_data_unref(fd);
g_free(old_path);
ViewFile *vf = data;
GtkTreePath *tpath;
- if (event->keyval != GDK_Menu) return FALSE;
+ if (event->keyval != GDK_KEY_Menu) return FALSE;
gtk_tree_view_get_cursor(GTK_TREE_VIEW(vf->listview), &tpath, NULL);
if (tpath)
gtk_tree_view_column_set_fixed_width(column, options->thumbnails.max_width + 4);
-#if GTK_CHECK_VERSION(2,18,0)
list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column));
-#else
- list = gtk_tree_view_column_get_cell_renderers(column);
-#endif
if (!list) return;
cell = list->data;
g_list_free(list);