static void _gth_browser_update_entry_point_list (GthBrowser *browser) { BrowserData *data; GList *entry_points; GList *scan; data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY); g_return_if_fail (data != NULL); g_menu_remove_all (data->entry_points_menu); entry_points = gth_main_get_all_entry_points (); for (scan = entry_points; scan; scan = scan->next) { GthFileData *file_data = scan->data; GMenuItem *item; char *uri; item = _g_menu_item_new_for_file (file_data->file, NULL); uri = g_file_get_uri (file_data->file); g_menu_item_set_action_and_target (item, "win.go-to-location", "s", uri); g_menu_append_item (data->entry_points_menu, item); g_free (uri); g_object_unref (item); } _g_object_list_unref (entry_points); }
static void update_entry_point_list (GthLocationChooser *self) { int first_position; int position; GList *entry_points; GList *scan; self->priv->update_entry_list_id = 0; clear_entry_point_list (self); if (! get_nth_separator_pos (self, 1, &first_position)) { GtkTreeIter iter; GtkTreePath *path; gtk_tree_store_append (self->priv->model, &iter, NULL); gtk_tree_store_set (self->priv->model, &iter, TYPE_COLUMN, ITEM_TYPE_SEPARATOR, -1); path = gtk_tree_model_get_path (GTK_TREE_MODEL (self->priv->model), &iter); if (path == NULL) return; first_position = gtk_tree_path_get_indices(path)[0]; gtk_tree_path_free (path); } position = first_position + 1; entry_points = gth_main_get_all_entry_points (); for (scan = entry_points; scan; scan = scan->next) { GthFileData *file_data = scan->data; add_file_source_entries (self, file_data->file, g_file_info_get_display_name (file_data->info), g_file_info_get_symbolic_icon (file_data->info), position++, FALSE, ITEM_TYPE_ENTRY_POINT); } _g_object_list_unref (entry_points); }