# HG changeset patch # User nadvornik # Date 1197844219 0 # Node ID b73743a013846ed8ec98875e1ce0a1c1832de621 # Parent dd6dc0a55d3dc429986619f4bbb1802d32367a6a fixed in-place rename diff -r dd6dc0a55d3d -r b73743a01384 src/view_file_list.c --- a/src/view_file_list.c Sat Dec 15 17:58:51 2007 +0000 +++ b/src/view_file_list.c Sun Dec 16 22:30:19 2007 +0000 @@ -109,6 +109,28 @@ gtk_tree_path_free(tpath); } + +static gint vflist_column_idx(ViewFileList *vfl, gint store_idx) +{ + GList *columns, *work; + gint i = 0; + + columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(vfl->listview)); + work = columns; + while (work) + { + GtkTreeViewColumn *column = work->data; + if (store_idx == GPOINTER_TO_INT(g_object_get_data (G_OBJECT(column), "column_store_idx"))) + break; + work = work->next; + i++; + } + + g_list_free(columns); + return i; +} + + /* *----------------------------------------------------------------------------- * dnd @@ -286,7 +308,7 @@ tpath = gtk_tree_model_get_path(store, &iter); tree_edit_by_path(GTK_TREE_VIEW(vfl->listview), tpath, - FILE_COLUMN_NAME -1, vfl->click_fd->name, + vflist_column_idx(vfl, FILE_COLUMN_NAME), vfl->click_fd->name, vflist_row_rename_cb, vfl); gtk_tree_path_free(tpath); }