Drop unused variables.
[geeqie.git] / src / view_file_list.c
index 2f4c40d..a230921 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Geeqie
  * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  * Author: John Ellis
  *
@@ -185,6 +185,10 @@ static gboolean vflist_store_clear_cb(GtkTreeModel *model, GtkTreePath *path, Gt
 {
        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;
 }
@@ -253,8 +257,6 @@ static void vflist_dnd_get(GtkWidget *widget, GdkDragContext *context,
 {
        ViewFile *vf = data;
        GList *list = NULL;
-       gchar *uri_text = NULL;
-       gint total;
 
        if (!VFLIST(vf)->click_fd) return;
 
@@ -268,15 +270,8 @@ static void vflist_dnd_get(GtkWidget *widget, GdkDragContext *context,
                }
 
        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)
@@ -305,7 +300,7 @@ static void vflist_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer
 
        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);
                }
@@ -322,7 +317,7 @@ static void vflist_drag_data_received(GtkWidget *entry_widget, GdkDragContext *c
 
                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);
@@ -516,7 +511,7 @@ static gboolean vflist_row_rename_cb(TreeEditData *td, const gchar *old, const g
        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);
@@ -549,7 +544,7 @@ gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer dat
        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)
@@ -1610,11 +1605,11 @@ void vflist_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode)
                        {
                        case MTS_MODE_SET: selected = mark_val;
                                break;
-                       case MTS_MODE_OR: selected = mark_val | selected;
+                       case MTS_MODE_OR: selected = mark_val || selected;
                                break;
-                       case MTS_MODE_AND: selected = mark_val & selected;
+                       case MTS_MODE_AND: selected = mark_val && selected;
                                break;
-                       case MTS_MODE_MINUS: selected = !mark_val & selected;
+                       case MTS_MODE_MINUS: selected = !mark_val && selected;
                                break;
                        }
 
@@ -1701,7 +1696,7 @@ static void vflist_listview_set_columns(GtkWidget *listview, gboolean thumb, gbo
 
        gtk_tree_view_column_set_fixed_width(column, options->thumbnails.max_width + 4);
 
-       list = gtk_tree_view_column_get_cell_renderers(column);
+       list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column));
        if (!list) return;
        cell = list->data;
        g_list_free(list);