// refresh TILP_EXPORT void on_tilp_button12_clicked(GtkButton* button, gpointer user_data) { if (!local.copy_cut) tilp_file_selection_destroy(); clist_refresh(); labels_refresh(); }
static void tree_selection_changed(GtkTreeSelection* selection, gpointer user_data) { GList *_list; GtkTreeIter iter; GtkTreeModel *model; GtkTreeSelection *sel; // destroy selection tilp_local_selection_destroy(); sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(ctree_wnd)); // create local selection for(_list = gtk_tree_selection_get_selected_rows(selection, &model); _list; _list = g_list_next(_list)) { GtkTreePath *path = _list->data; FileEntry *fe; gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get(model, &iter, COLUMN_DATA, &fe, -1); tilp_local_selection_add(fe->name); } g_list_foreach(_list, (GFunc)gtk_tree_path_free, NULL); g_list_free(_list); // create file selection _list = gtk_tree_selection_get_selected_rows(selection, &model); if(_list) { tilp_file_selection_destroy(); for(; _list; _list = g_list_next(_list)) { GtkTreePath *path = _list->data; FileEntry *fe; gchar *full_path; gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get(model, &iter, COLUMN_DATA, &fe, -1); full_path = g_strconcat(local.cwdir, G_DIR_SEPARATOR_S, fe->name, NULL); tilp_file_selection_add(full_path); } g_list_foreach(_list, (GFunc)gtk_tree_path_free, NULL); g_list_free(_list); } }