diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 749a4cd209..8b5cc443a9 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -214,8 +214,6 @@ typedef struct _GtkFileChooserWidgetClass GtkFileChooserWidgetClass; struct _GtkFileChooserWidget { GtkWidget parent_instance; - - GtkFileChooserWidgetPrivate *priv; }; struct _GtkFileChooserWidgetClass @@ -658,7 +656,7 @@ gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface) static void pending_select_files_free (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_slist_free_full (priv->pending_select_files, g_object_unref); priv->pending_select_files = NULL; @@ -666,9 +664,9 @@ pending_select_files_free (GtkFileChooserWidget *impl) static void pending_select_files_add (GtkFileChooserWidget *impl, - GFile *file) + GFile *file) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); priv->pending_select_files = g_slist_prepend (priv->pending_select_files, g_object_ref (file)); @@ -678,7 +676,7 @@ static void gtk_file_chooser_widget_finalize (GObject *object) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (object); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_clear_pointer (&priv->choices, g_hash_table_unref); @@ -698,15 +696,13 @@ gtk_file_chooser_widget_finalize (GObject *object) stop_loading_and_clear_list_model (impl, FALSE); search_clear_model (impl, FALSE); recent_clear_model (impl, FALSE); - g_clear_object (&impl->priv->model_for_search); + g_clear_object (&priv->model_for_search); /* stopping the load above should have cleared this */ g_assert (priv->load_timeout_id == 0); g_free (priv->preview_display_name); - impl->priv = NULL; - G_OBJECT_CLASS (gtk_file_chooser_widget_parent_class)->finalize (object); } @@ -899,7 +895,7 @@ emit_default_size_changed (GtkFileChooserWidget *impl) static void update_preview_widget_visibility (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->use_preview_label) { @@ -932,7 +928,7 @@ static void set_preview_widget (GtkFileChooserWidget *impl, GtkWidget *preview_widget) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (preview_widget == priv->preview_widget) return; @@ -956,7 +952,7 @@ new_folder_popover_active (GtkWidget *button, GParamSpec *pspec, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_editable_set_text (GTK_EDITABLE (priv->new_folder_name_entry), ""); gtk_widget_set_sensitive (priv->new_folder_create_button, FALSE); @@ -983,7 +979,7 @@ name_exists_get_info_cb (GCancellable *cancellable, { struct FileExistsData *data = user_data; GtkFileChooserWidget *impl = data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (cancellable != priv->file_exists_get_info_cancellable) goto out; @@ -1022,7 +1018,7 @@ check_valid_child_name (GtkFileChooserWidget *impl, GtkWidget *error_stack, GtkWidget *button) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkFileChooserErrorStack *stack = GTK_FILE_CHOOSER_ERROR_STACK (error_stack); gtk_widget_set_sensitive (button, FALSE); @@ -1090,7 +1086,7 @@ static void new_folder_name_changed (GtkEditable *editable, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); check_valid_child_name (impl, priv->current_folder, @@ -1105,7 +1101,7 @@ static void new_folder_create_clicked (GtkButton *button, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GError *error = NULL; GFile *file; const gchar *name; @@ -1169,7 +1165,7 @@ selection_check (GtkFileChooserWidget *impl, gboolean *all_files, gboolean *all_folders) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); struct selection_check_closure closure; GtkTreeSelection *selection; @@ -1214,7 +1210,7 @@ places_sidebar_open_location_cb (GtkPlacesSidebar *sidebar, GtkPlacesOpenFlags open_flags, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean clear_entry; /* In the Save modes, we want to preserve what the user typed in the filename @@ -1266,9 +1262,10 @@ should_trigger_location_entry (GtkFileChooserWidget *impl, GdkModifierType state, const char **string) { + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GdkModifierType no_text_input_mask; - if (impl->priv->operation_mode == OPERATION_MODE_SEARCH) + if (priv->operation_mode == OPERATION_MODE_SEARCH) return FALSE; no_text_input_mask = @@ -1309,7 +1306,7 @@ key_press_cb (GtkEventControllerKey *controller, gpointer data) { GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); const char *string; if (should_trigger_location_entry (impl, keyval, state, &string) && @@ -1357,7 +1354,7 @@ widget_key_press_cb (GtkEventControllerKey *controller, gpointer data) { GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean handled = FALSE; const char *string; @@ -1396,7 +1393,7 @@ add_bookmark_foreach_cb (GtkTreeModel *model, gpointer data) { GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *file; gtk_tree_model_get (model, iter, @@ -1415,7 +1412,7 @@ add_to_shortcuts_cb (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); @@ -1487,7 +1484,7 @@ delete_file_cb (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); @@ -1517,7 +1514,7 @@ trash_file_cb (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); @@ -1528,7 +1525,7 @@ static void rename_file_name_changed (GtkEntry *entry, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFileType file_type; file_type = g_file_query_file_type (priv->rename_file_source_file, @@ -1547,14 +1544,15 @@ static void rename_file_end (GtkPopover *popover, GtkFileChooserWidget *impl) { - g_object_unref (impl->priv->rename_file_source_file); + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); + g_object_unref (priv->rename_file_source_file); } static void rename_file_rename_clicked (GtkButton *button, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *dest; const gchar* new_name; @@ -1589,7 +1587,7 @@ rename_selected_cb (GtkTreeModel *model, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GdkRectangle rect; gchar *filename; @@ -1618,7 +1616,7 @@ rename_file_cb (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; /* insensitive until we change the name */ @@ -1716,7 +1714,7 @@ change_show_size_state (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_simple_action_set_state (action, state); priv->show_size_column = g_variant_get_boolean (state); @@ -1731,7 +1729,7 @@ change_sort_directories_first_state (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSortable *sortable; g_simple_action_set_state (action, state); @@ -1754,7 +1752,7 @@ static void clear_model_cache (GtkFileChooserWidget *impl, gint column) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->browse_files_model) _gtk_file_system_model_clear_cache (priv->browse_files_model, column); @@ -1770,7 +1768,7 @@ static void set_model_filter (GtkFileChooserWidget *impl, GtkFileFilter *filter) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->browse_files_model) _gtk_file_system_model_set_filter (priv->browse_files_model, filter); @@ -1785,7 +1783,7 @@ set_model_filter (GtkFileChooserWidget *impl, static void update_time_renderer_visible (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_object_set (priv->list_time_renderer, "visible", priv->show_time, @@ -1801,7 +1799,7 @@ change_show_time_state (GSimpleAction *action, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_simple_action_set_state (action, state); priv->show_time = g_variant_get_boolean (state); @@ -1859,7 +1857,7 @@ file_list_drag_data_received_get_info_cb (GCancellable *cancellable, gboolean cancelled = g_cancellable_is_cancelled (cancellable); struct FileListDragData *data = user_data; GtkFileChooser *chooser = GTK_FILE_CHOOSER (data->impl); - GtkFileChooserWidgetPrivate *priv = data->impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (data->impl); if (cancellable != priv->file_list_drag_data_received_cancellable) goto out; @@ -1904,7 +1902,7 @@ file_list_drag_data_received_cb (GtkWidget *widget, gpointer user_data) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (user_data); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gchar **uris; char *uri; GFile *file; @@ -1962,7 +1960,9 @@ file_list_drag_begin_cb (GtkWidget *widget, GdkDrag *drag, GtkFileChooserWidget *impl) { - gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (impl->priv->places_sidebar), + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); + + gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (priv->places_sidebar), TRUE, drag); } @@ -1985,10 +1985,10 @@ file_list_drag_end_cb (GtkWidget *widget, GdkDrag *drag, gpointer user_data) { - GtkFileChooserWidget *impl; + GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (user_data); + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); - impl = GTK_FILE_CHOOSER_WIDGET (user_data); - gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (impl->priv->places_sidebar), + gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (priv->places_sidebar), FALSE, drag); } @@ -1999,7 +1999,7 @@ file_list_drag_end_cb (GtkWidget *widget, static void check_file_list_popover_sensitivity (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gint num_selected; gboolean all_files; gboolean all_folders; @@ -2099,13 +2099,14 @@ static GActionEntry entries[] = { static void add_actions (GtkFileChooserWidget *impl) { + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GActionGroup *actions; actions = G_ACTION_GROUP (g_simple_action_group_new ()); g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), impl); - gtk_widget_insert_action_group (GTK_WIDGET (impl->priv->browse_files_tree_view), "item", actions); + gtk_widget_insert_action_group (GTK_WIDGET (priv->browse_files_tree_view), "item", actions); g_object_unref (actions); } @@ -2148,7 +2149,7 @@ add_button (GtkWidget *box, static void file_list_build_popover (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *box; if (priv->browse_files_popover) @@ -2179,7 +2180,7 @@ file_list_build_popover (GtkFileChooserWidget *impl) static void file_list_update_popover (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GActionGroup *actions; GAction *action; @@ -2220,7 +2221,7 @@ file_list_show_popover (GtkFileChooserWidget *impl, gdouble x, gdouble y) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GdkRectangle rect; GtkTreeSelection *selection; GtkTreeModel *model; @@ -2266,7 +2267,7 @@ static gboolean list_popup_menu_cb (GtkWidget *widget, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); graphene_rect_t bounds; if (gtk_widget_compute_bounds (priv->browse_files_tree_view, @@ -2339,7 +2340,7 @@ typedef struct { static void file_list_set_sort_column_ids (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), -1); @@ -2358,7 +2359,7 @@ file_list_query_tooltip_cb (GtkWidget *widget, gpointer user_data) { GtkFileChooserWidget *impl = user_data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; @@ -2401,7 +2402,7 @@ file_list_query_tooltip_cb (GtkWidget *widget, static void set_icon_cell_renderer_fixed_size (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gint xpad, ypad; gtk_cell_renderer_get_padding (priv->list_pixbuf_renderer, &xpad, &ypad); @@ -2414,7 +2415,7 @@ static gboolean location_changed_timeout_cb (gpointer user_data) { GtkFileChooserWidget *impl = user_data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (impl)); check_preview_change (impl); @@ -2428,7 +2429,7 @@ location_changed_timeout_cb (gpointer user_data) static void reset_location_timeout (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->location_changed_id > 0) g_source_remove (priv->location_changed_id); @@ -2442,7 +2443,7 @@ static void location_entry_changed_cb (GtkEditable *editable, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->operation_mode == OPERATION_MODE_SEARCH) { @@ -2467,7 +2468,7 @@ location_entry_close_clicked (GtkFileChooserWidget *impl) static void location_entry_setup (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) @@ -2490,7 +2491,7 @@ location_entry_setup (GtkFileChooserWidget *impl) static void location_entry_disconnect (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->location_entry) g_signal_handlers_disconnect_by_func (priv->location_entry, location_entry_changed_cb, impl); @@ -2499,7 +2500,7 @@ location_entry_disconnect (GtkFileChooserWidget *impl) static void location_entry_create (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (!priv->location_entry) { @@ -2530,7 +2531,7 @@ forward_key (GtkEventControllerKey *key, static void save_widgets_create (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *vbox; GtkWidget *widget; @@ -2585,7 +2586,7 @@ save_widgets_create (GtkFileChooserWidget *impl) static void save_widgets_destroy (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->external_entry && priv->external_entry == priv->location_entry) { @@ -2611,7 +2612,7 @@ save_widgets_destroy (GtkFileChooserWidget *impl) static void location_switch_to_path_bar (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->location_entry) { @@ -2629,7 +2630,7 @@ location_switch_to_path_bar (GtkFileChooserWidget *impl) static void location_switch_to_filename_entry (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); /* when in search or recent files mode, we are not showing the * browse_header_box container, so there's no point in switching @@ -2662,7 +2663,7 @@ static void location_mode_set (GtkFileChooserWidget *impl, LocationMode new_mode) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) @@ -2715,7 +2716,7 @@ places_sidebar_show_other_locations_with_flags_cb (GtkPlacesSidebar *sidebar GtkPlacesOpenFlags open_flags, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); priv->preview_widget_active = FALSE; @@ -2727,7 +2728,7 @@ places_sidebar_show_other_locations_with_flags_cb (GtkPlacesSidebar *sidebar static void location_toggle_popup_handler (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if ((priv->operation_mode == OPERATION_MODE_RECENT || priv->operation_mode == OPERATION_MODE_SEARCH) && @@ -2766,7 +2767,7 @@ static void gtk_file_chooser_widget_constructed (GObject *object) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (object); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); @@ -2782,9 +2783,11 @@ gtk_file_chooser_widget_constructed (GObject *object) static void update_extra_and_filters (GtkFileChooserWidget *impl) { - gtk_widget_set_visible (impl->priv->extra_and_filters, - gtk_widget_get_visible (impl->priv->extra_align) || - gtk_widget_get_visible (impl->priv->filter_combo_hbox)); + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); + + gtk_widget_set_visible (priv->extra_and_filters, + gtk_widget_get_visible (priv->extra_align) || + gtk_widget_get_visible (priv->filter_combo_hbox)); } /* Sets the extra_widget by packing it in the appropriate place */ @@ -2792,7 +2795,7 @@ static void set_extra_widget (GtkFileChooserWidget *impl, GtkWidget *extra_widget) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (extra_widget) g_object_ref (extra_widget); @@ -2836,7 +2839,7 @@ static void set_local_only (GtkFileChooserWidget *impl, gboolean local_only) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (local_only != priv->local_only) { @@ -2865,7 +2868,7 @@ set_select_multiple (GtkFileChooserWidget *impl, gboolean select_multiple, gboolean property_notify) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; GtkSelectionMode mode; @@ -2888,7 +2891,7 @@ set_select_multiple (GtkFileChooserWidget *impl, static void set_file_system_backend (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start for backend", "default"); @@ -2900,7 +2903,7 @@ set_file_system_backend (GtkFileChooserWidget *impl) static void unset_file_system_backend (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_object_unref (priv->file_system); @@ -2911,7 +2914,7 @@ unset_file_system_backend (GtkFileChooserWidget *impl) static void put_recent_folder_in_pathbar (GtkFileChooserWidget *impl, GtkTreeIter *iter) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *file; gtk_tree_model_get (GTK_TREE_MODEL (priv->recent_model), iter, @@ -2930,7 +2933,7 @@ put_recent_folder_in_pathbar (GtkFileChooserWidget *impl, GtkTreeIter *iter) static void location_bar_update (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean visible = TRUE; gboolean create_folder_visible = FALSE; @@ -2986,19 +2989,21 @@ static void operation_mode_stop (GtkFileChooserWidget *impl, OperationMode mode) { + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); + if (mode == OPERATION_MODE_SEARCH) { - g_clear_object (&impl->priv->model_for_search); + g_clear_object (&priv->model_for_search); search_stop_searching (impl, TRUE); search_clear_model (impl, TRUE); - gtk_widget_hide (impl->priv->remote_warning_bar); + gtk_widget_hide (priv->remote_warning_bar); } } static void operation_mode_set_enter_location (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list"); gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "location"); @@ -3011,7 +3016,7 @@ operation_mode_set_enter_location (GtkFileChooserWidget *impl) static void operation_mode_set_browse (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_places_sidebar_set_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), priv->current_folder); gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list"); @@ -3025,7 +3030,7 @@ operation_mode_set_browse (GtkFileChooserWidget *impl) static void operation_mode_set_search (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *visible_widget; g_assert (priv->search_model == NULL); @@ -3049,7 +3054,7 @@ operation_mode_set_search (GtkFileChooserWidget *impl) static void operation_mode_set_recent (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *file; gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list"); @@ -3067,7 +3072,7 @@ operation_mode_set_recent (GtkFileChooserWidget *impl) static void operation_mode_set_other_locations (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "other_locations"); gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar"); @@ -3084,7 +3089,7 @@ operation_mode_set_other_locations (GtkFileChooserWidget *impl) static void operation_mode_set (GtkFileChooserWidget *impl, OperationMode mode) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); OperationMode old_mode; operation_mode_stop (impl, priv->operation_mode); @@ -3133,7 +3138,7 @@ operation_mode_set (GtkFileChooserWidget *impl, OperationMode mode) static void update_appearance (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) @@ -3174,7 +3179,7 @@ update_appearance (GtkFileChooserWidget *impl) static gchar * gtk_file_chooser_widget_get_subtitle (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gchar *subtitle = NULL; if (priv->operation_mode == OPERATION_MODE_SEARCH) @@ -3223,7 +3228,7 @@ static void set_show_hidden (GtkFileChooserWidget *impl, gboolean show_hidden) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->show_hidden != show_hidden) { @@ -3242,7 +3247,7 @@ gtk_file_chooser_widget_set_property (GObject *object, { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (object); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); switch (prop_id) { @@ -3368,7 +3373,7 @@ gtk_file_chooser_widget_get_property (GObject *object, GParamSpec *pspec) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (object); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); switch (prop_id) { @@ -3434,7 +3439,7 @@ gtk_file_chooser_widget_get_property (GObject *object, static void cancel_all_operations (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); pending_select_files_free (impl); @@ -3452,7 +3457,7 @@ static void remove_settings_signal (GtkFileChooserWidget *impl, GdkDisplay *display) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->settings_signal_id) { @@ -3469,7 +3474,7 @@ static void gtk_file_chooser_widget_dispose (GObject *object) { GtkFileChooserWidget *impl = (GtkFileChooserWidget *) object; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); cancel_all_operations (impl); @@ -3500,7 +3505,7 @@ toplevel_set_focus_cb (GtkWindow *window, GParamSpec *pspec, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); priv->toplevel_last_focus_widget = priv->toplevel_current_focus_widget; priv->toplevel_current_focus_widget = gtk_root_get_focus (GTK_ROOT (window)); @@ -3513,7 +3518,7 @@ static void gtk_file_chooser_widget_root (GtkWidget *widget) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (widget); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *toplevel; GTK_WIDGET_CLASS (gtk_file_chooser_widget_parent_class)->root (widget); @@ -3531,7 +3536,7 @@ static void gtk_file_chooser_widget_unroot (GtkWidget *widget) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (widget); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *toplevel; toplevel = gtk_widget_get_toplevel (widget); @@ -3554,7 +3559,7 @@ gtk_file_chooser_widget_unroot (GtkWidget *widget) static void change_icon_theme (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); @@ -3591,7 +3596,7 @@ settings_notify_cb (GObject *object, static void check_icon_theme (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkSettings *settings; profile_start ("start", NULL); @@ -3634,7 +3639,7 @@ gtk_file_chooser_widget_style_updated (GtkWidget *widget) static void set_sort_column (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSortable *sortable; sortable = GTK_TREE_SORTABLE (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->browse_files_tree_view))); @@ -3651,7 +3656,7 @@ set_sort_column (GtkFileChooserWidget *impl) static void settings_load (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean show_hidden; gboolean show_size_column; gboolean sort_directories_first; @@ -3705,7 +3710,7 @@ settings_load (GtkFileChooserWidget *impl) static void settings_save (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GSettings *settings; settings = _gtk_file_chooser_get_settings_for_widget (GTK_WIDGET (impl)); @@ -3768,7 +3773,7 @@ recent_files_setting_is_enabled (GtkFileChooserWidget *impl) static void set_startup_mode (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkRevealerTransitionType revealer_transition; GtkStackTransitionType stack_transition; @@ -3809,7 +3814,7 @@ set_startup_mode (GtkFileChooserWidget *impl) static gboolean shortcut_exists (GtkFileChooserWidget *impl, GFile *needle) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GSList *haystack; GSList *l; gboolean exists; @@ -3836,7 +3841,7 @@ shortcut_exists (GtkFileChooserWidget *impl, GFile *needle) static void add_cwd_to_sidebar_if_needed (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); char *cwd; GFile *cwd_file; GFile *home_file; @@ -3870,7 +3875,7 @@ static void gtk_file_chooser_widget_map (GtkWidget *widget) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (widget); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); @@ -3907,7 +3912,7 @@ static void gtk_file_chooser_widget_unmap (GtkWidget *widget) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (widget); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); settings_save (impl); @@ -3923,7 +3928,7 @@ compare_directory (GtkFileSystemModel *model, GtkTreeIter *b, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean dir_a, dir_b; dir_a = g_value_get_boolean (_gtk_file_system_model_get_value (model, a, MODEL_COL_IS_FOLDER)); @@ -4107,7 +4112,7 @@ static void list_sort_column_changed_cb (GtkTreeSortable *sortable, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gint sort_column_id; GtkSortType sort_type; @@ -4142,7 +4147,7 @@ update_columns (GtkFileChooserWidget *impl, gboolean location_visible, const gchar *time_title) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean need_resize = FALSE; if (gtk_tree_view_column_get_visible (priv->list_location_column) != location_visible) @@ -4170,7 +4175,7 @@ update_columns (GtkFileChooserWidget *impl, static void load_set_model (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); @@ -4195,7 +4200,7 @@ static gboolean load_timeout_cb (gpointer data) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (data); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); @@ -4217,7 +4222,7 @@ load_timeout_cb (gpointer data) static void load_setup_timer (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_assert (priv->load_timeout_id == 0); g_assert (priv->load_state != LOAD_PRELOAD); @@ -4231,7 +4236,7 @@ load_setup_timer (GtkFileChooserWidget *impl) static void load_remove_timer (GtkFileChooserWidget *impl, LoadState new_load_state) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->load_timeout_id != 0) { @@ -4255,7 +4260,7 @@ load_remove_timer (GtkFileChooserWidget *impl, LoadState new_load_state) static void browse_files_select_first_row (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreePath *path; GtkTreeIter dummy_iter; GtkTreeModel *tree_model; @@ -4300,13 +4305,13 @@ center_selected_row_foreach_cb (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { - struct center_selected_row_closure *closure; + struct center_selected_row_closure *closure = data; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (closure->impl); - closure = data; if (closure->already_centered) return; - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (closure->impl->priv->browse_files_tree_view), path, NULL, TRUE, 0.5, 0.0); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->browse_files_tree_view), path, NULL, TRUE, 0.5, 0.0); closure->already_centered = TRUE; } @@ -4314,7 +4319,7 @@ center_selected_row_foreach_cb (GtkTreeModel *model, static void browse_files_center_selected_row (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); struct center_selected_row_closure closure; GtkTreeSelection *selection; @@ -4329,7 +4334,7 @@ static gboolean show_and_select_files (GtkFileChooserWidget *impl, GSList *files) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; GtkFileSystemModel *fsmodel; gboolean enabled_hidden, removed_filters; @@ -4415,7 +4420,7 @@ show_and_select_files (GtkFileChooserWidget *impl, static void pending_select_files_process (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_assert (priv->load_state == LOAD_FINISHED); g_assert (priv->browse_files_model != NULL); @@ -4446,7 +4451,7 @@ pending_select_files_process (GtkFileChooserWidget *impl) static void show_error_on_reading_current_folder (GtkFileChooserWidget *impl, GError *error) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFileInfo *info; char *msg; @@ -4473,7 +4478,7 @@ browse_files_model_finished_loading_cb (GtkFileSystemModel *model, GError *error, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); @@ -4518,7 +4523,7 @@ static void stop_loading_and_clear_list_model (GtkFileChooserWidget *impl, gboolean remove) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); load_remove_timer (impl, LOAD_EMPTY); @@ -4698,7 +4703,7 @@ file_system_model_set (GtkFileSystemModel *model, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); switch (column) { @@ -4902,7 +4907,7 @@ static gboolean set_list_model (GtkFileChooserWidget *impl, GError **error) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_assert (priv->current_folder != NULL); @@ -4988,7 +4993,7 @@ update_chooser_entry_selected_foreach (GtkTreeModel *model, static void update_chooser_entry (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; struct update_chooser_entry_selected_foreach_closure closure; @@ -5154,7 +5159,7 @@ update_current_folder_mount_enclosing_volume_cb (GCancellable *cancellabl { struct UpdateCurrentFolderData *data = user_data; GtkFileChooserWidget *impl = data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gboolean cancelled = g_cancellable_is_cancelled (cancellable); if (cancellable != priv->update_current_folder_cancellable) @@ -5192,7 +5197,7 @@ update_current_folder_get_info_cb (GCancellable *cancellable, gboolean cancelled = g_cancellable_is_cancelled (cancellable); struct UpdateCurrentFolderData *data = user_data; GtkFileChooserWidget *impl = data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (cancellable != priv->update_current_folder_cancellable) goto out; @@ -5348,7 +5353,7 @@ gtk_file_chooser_widget_update_current_folder (GtkFileChooser *chooser, GError **error) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); struct UpdateCurrentFolderData *data; profile_start ("start", NULL); @@ -5398,7 +5403,7 @@ static GFile * gtk_file_chooser_widget_get_current_folder (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->operation_mode == OPERATION_MODE_RECENT) return NULL; @@ -5414,7 +5419,7 @@ gtk_file_chooser_widget_set_current_name (GtkFileChooser *chooser, const gchar *name) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_return_if_fail (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER); @@ -5427,7 +5432,7 @@ static gchar * gtk_file_chooser_widget_get_current_name (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_return_val_if_fail (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, @@ -5442,7 +5447,7 @@ gtk_file_chooser_widget_select_file (GtkFileChooser *chooser, GError **error) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *parent_file; gboolean same_path; GtkFileSystemModel *fsmodel; @@ -5504,7 +5509,7 @@ gtk_file_chooser_widget_unselect_file (GtkFileChooser *chooser, GFile *file) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeView *tree_view; GtkTreeModel *model; GtkTreeIter iter; @@ -5527,7 +5532,7 @@ maybe_select (GtkTreeModel *model, gpointer data) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (data); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; gboolean is_sensitive; gboolean is_folder; @@ -5553,7 +5558,7 @@ static void gtk_file_chooser_widget_select_all (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->operation_mode == OPERATION_MODE_SEARCH || priv->operation_mode == OPERATION_MODE_RECENT) @@ -5574,7 +5579,7 @@ static void gtk_file_chooser_widget_unselect_all (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); gtk_tree_selection_unselect_all (selection); @@ -5598,7 +5603,7 @@ check_save_entry (GtkFileChooserWidget *impl, gboolean *is_file_part_empty_ret, gboolean *is_folder) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkFileChooserEntry *chooser_entry; GFile *current_folder; const char *file_part; @@ -5702,7 +5707,7 @@ static GSList * gtk_file_chooser_widget_get_files (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); struct get_files_closure info; GtkWindow *toplevel; GtkWidget *current_focus; @@ -5812,7 +5817,7 @@ GFile * gtk_file_chooser_widget_get_preview_file (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->preview_file) return g_object_ref (priv->preview_file); @@ -5824,7 +5829,7 @@ static GtkFileSystem * gtk_file_chooser_widget_get_file_system (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); return priv->file_system; } @@ -5834,7 +5839,7 @@ static void show_filters (GtkFileChooserWidget *impl, gboolean show) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_widget_set_visible (priv->filter_combo_hbox, show); update_extra_and_filters (impl); @@ -5845,7 +5850,7 @@ gtk_file_chooser_widget_add_filter (GtkFileChooser *chooser, GtkFileFilter *filter) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); const gchar *name; if (g_slist_find (priv->filters, filter)) @@ -5874,7 +5879,7 @@ gtk_file_chooser_widget_remove_filter (GtkFileChooser *chooser, GtkFileFilter *filter) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeModel *model; GtkTreeIter iter; gint filter_index; @@ -5914,7 +5919,7 @@ static GSList * gtk_file_chooser_widget_list_filters (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); return g_slist_copy (priv->filters); } @@ -5925,7 +5930,7 @@ gtk_file_chooser_widget_add_shortcut_folder (GtkFileChooser *chooser, GError **error) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_places_sidebar_add_shortcut (GTK_PLACES_SIDEBAR (priv->places_sidebar), file); return TRUE; @@ -5937,7 +5942,7 @@ gtk_file_chooser_widget_remove_shortcut_folder (GtkFileChooser *chooser, GError **error) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_places_sidebar_remove_shortcut (GTK_PLACES_SIDEBAR (priv->places_sidebar), file); return TRUE; @@ -5947,7 +5952,7 @@ static GSList * gtk_file_chooser_widget_list_shortcut_folders (GtkFileChooser *chooser) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); return gtk_places_sidebar_list_shortcuts (GTK_PLACES_SIDEBAR (priv->places_sidebar)); } @@ -5983,7 +5988,7 @@ gtk_file_chooser_widget_get_default_size (GtkFileChooserEmbed *chooser_embed, gint *default_height) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser_embed); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkRequisition req; int width, height; GSettings *settings; @@ -6044,7 +6049,7 @@ switch_folder_foreach_cb (GtkTreeModel *model, static void switch_to_selected_folder (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; struct switch_folder_closure closure; @@ -6071,7 +6076,7 @@ static GFileInfo * get_selected_file_info_from_file_list (GtkFileChooserWidget *impl, gboolean *had_selection) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; GtkTreeIter iter; GFileInfo *info; @@ -6183,7 +6188,7 @@ confirmation_confirm_get_info_cb (GCancellable *cancellable, gboolean cancelled = g_cancellable_is_cancelled (cancellable); gboolean should_respond = FALSE; struct GetDisplayNameData *data = user_data; - GtkFileChooserWidgetPrivate *priv = data->impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (data->impl); if (cancellable != priv->should_respond_get_info_cancellable) goto out; @@ -6219,7 +6224,7 @@ should_respond_after_confirm_overwrite (GtkFileChooserWidget *impl, const gchar *file_part, GFile *parent_file) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkFileChooserConfirmation conf; if (!priv->do_overwrite_confirmation) @@ -6276,7 +6281,7 @@ name_entry_get_parent_info_cb (GCancellable *cancellable, gboolean cancelled = g_cancellable_is_cancelled (cancellable); struct FileExistsData *data = user_data; GtkFileChooserWidget *impl = data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (cancellable != priv->should_respond_get_info_cancellable) goto out; @@ -6396,7 +6401,7 @@ file_exists_get_info_cb (GCancellable *cancellable, gboolean needs_parent_check = FALSE; struct FileExistsData *data = user_data; GtkFileChooserWidget *impl = data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (cancellable != priv->file_exists_get_info_cancellable) goto out; @@ -6539,7 +6544,7 @@ location_popup_on_paste_handler (GtkFileChooserWidget *impl) static void add_selection_to_recent_list (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GSList *files; GSList *l; @@ -6565,7 +6570,7 @@ static gboolean gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser_embed); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *toplevel; GtkWidget *current_focus; gboolean retval; @@ -6817,7 +6822,7 @@ static void gtk_file_chooser_widget_initial_focus (GtkFileChooserEmbed *chooser_embed) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser_embed); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *widget; if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || @@ -6863,7 +6868,7 @@ selected_foreach_get_file_cb (GtkTreeModel *model, static GSList * get_selected_files (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GSList *result; GtkTreeSelection *selection; @@ -6894,7 +6899,7 @@ selected_foreach_get_info_cb (GtkTreeModel *model, static GSList * get_selected_infos (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GSList *result; GtkTreeSelection *selection; @@ -6913,6 +6918,7 @@ search_engine_hits_added_cb (GtkSearchEngine *engine, GList *hits, GtkFileChooserWidget *impl) { + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GList *l, *files, *files_with_info, *infos; GFile *file; @@ -6932,16 +6938,16 @@ search_engine_hits_added_cb (GtkSearchEngine *engine, files = g_list_prepend (files, file); } - _gtk_file_system_model_update_files (impl->priv->search_model, + _gtk_file_system_model_update_files (priv->search_model, files_with_info, infos); - _gtk_file_system_model_add_and_query_files (impl->priv->search_model, + _gtk_file_system_model_add_and_query_files (priv->search_model, files, MODEL_ATTRIBUTES); g_list_free_full (files, g_object_unref); g_list_free_full (files_with_info, g_object_unref); g_list_free_full (infos, g_object_unref); - gtk_stack_set_visible_child_name (GTK_STACK (impl->priv->browse_files_stack), "list"); + gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list"); } /* Callback used from GtkSearchEngine when the query is done running */ @@ -6950,7 +6956,7 @@ search_engine_finished_cb (GtkSearchEngine *engine, gpointer data) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (data); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); set_busy_cursor (impl, FALSE); gtk_widget_hide (priv->search_spinner); @@ -6984,7 +6990,7 @@ static void search_clear_model (GtkFileChooserWidget *impl, gboolean remove) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (!priv->search_model) return; @@ -7001,7 +7007,7 @@ static void search_stop_searching (GtkFileChooserWidget *impl, gboolean remove_query) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (remove_query && priv->search_entry) { @@ -7029,7 +7035,7 @@ search_stop_searching (GtkFileChooserWidget *impl, static void search_setup_model (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_assert (priv->search_model == NULL); @@ -7059,7 +7065,7 @@ static gboolean show_spinner (gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_widget_show (priv->search_spinner); gtk_spinner_start (GTK_SPINNER (priv->search_spinner)); @@ -7073,7 +7079,7 @@ static void search_start_query (GtkFileChooserWidget *impl, const gchar *query_text) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *file; if (gtk_stack_get_visible_child (GTK_STACK (priv->browse_files_stack)) == priv->places_view) @@ -7135,7 +7141,7 @@ search_start_query (GtkFileChooserWidget *impl, static void search_entry_activate_cb (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); const char *text; if (priv->operation_mode != OPERATION_MODE_SEARCH) @@ -7157,19 +7163,21 @@ search_entry_activate_cb (GtkFileChooserWidget *impl) static void search_entry_stop_cb (GtkFileChooserWidget *impl) { - if (impl->priv->search_engine) + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); + + if (priv->search_engine) search_stop_searching (impl, FALSE); else g_object_set (impl, "search-mode", FALSE, NULL); - impl->priv->starting_search = FALSE; + priv->starting_search = FALSE; } /* Hides the path bar and creates the search entry */ static void search_setup_widgets (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); /* if there already is a query, restart it */ if (priv->search_query) @@ -7199,7 +7207,7 @@ static void recent_clear_model (GtkFileChooserWidget *impl, gboolean remove) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (!priv->recent_model) return; @@ -7216,7 +7224,7 @@ recent_clear_model (GtkFileChooserWidget *impl, static void recent_stop_loading (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->load_recent_id) { @@ -7228,7 +7236,7 @@ recent_stop_loading (GtkFileChooserWidget *impl) static void recent_setup_model (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_assert (priv->recent_model == NULL); @@ -7256,7 +7264,7 @@ recent_idle_cleanup (gpointer data) { RecentLoadData *load_data = data; GtkFileChooserWidget *impl = load_data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_tree_view_set_model (GTK_TREE_VIEW (priv->browse_files_tree_view), GTK_TREE_MODEL (priv->recent_model)); @@ -7300,7 +7308,7 @@ static void populate_model_with_recent_items (GtkFileChooserWidget *impl, GList *items) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gint limit; GList *l; gint n; @@ -7335,7 +7343,7 @@ static void populate_model_with_folders (GtkFileChooserWidget *impl, GList *items) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GList *folders; GList *l; @@ -7354,7 +7362,7 @@ recent_idle_load (gpointer data) { RecentLoadData *load_data = data; GtkFileChooserWidget *impl = load_data->impl; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (!priv->recent_manager) return FALSE; @@ -7377,7 +7385,7 @@ recent_idle_load (gpointer data) static void recent_start_loading (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); RecentLoadData *load_data; recent_stop_loading (impl); @@ -7405,7 +7413,7 @@ recent_start_loading (GtkFileChooserWidget *impl) static gboolean recent_should_respond (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; g_assert (priv->operation_mode == OPERATION_MODE_RECENT); @@ -7418,7 +7426,7 @@ static void set_current_filter (GtkFileChooserWidget *impl, GtkFileFilter *filter) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->current_filter != filter) { @@ -7448,7 +7456,7 @@ static void filter_combo_changed (GtkComboBox *combo_box, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gint new_index; GtkFileFilter *new_filter; @@ -7464,7 +7472,7 @@ filter_combo_changed (GtkComboBox *combo_box, static void check_preview_change (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreePath *path; GFile *new_file; char *new_display_name; @@ -7555,7 +7563,7 @@ list_select_func (GtkTreeSelection *selection, gpointer data) { GtkFileChooserWidget *impl = data; - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) @@ -7581,7 +7589,7 @@ static void list_selection_changed (GtkTreeSelection *selection, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->browse_files_tree_view)) == NULL) return; @@ -7628,7 +7636,7 @@ list_row_activated (GtkTreeView *tree_view, GtkTreeViewColumn *column, GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *file; GtkTreeIter iter; GtkTreeModel *model; @@ -7686,7 +7694,7 @@ path_bar_clicked (GtkPathBar *path_bar, static void update_cell_renderer_attributes (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_tree_view_column_set_attributes (priv->list_name_column, priv->list_pixbuf_renderer, @@ -7731,7 +7739,7 @@ static void location_set_user_text (GtkFileChooserWidget *impl, const gchar *path) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), path); gtk_editable_set_position (GTK_EDITABLE (priv->location_entry), -1); @@ -7741,7 +7749,7 @@ static void location_popup_handler (GtkFileChooserWidget *impl, const gchar *path) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->operation_mode != OPERATION_MODE_BROWSE) { @@ -7776,7 +7784,7 @@ location_popup_handler (GtkFileChooserWidget *impl, static void up_folder_handler (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); _gtk_path_bar_up (GTK_PATH_BAR (priv->browse_path_bar)); } @@ -7785,7 +7793,7 @@ up_folder_handler (GtkFileChooserWidget *impl) static void down_folder_handler (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); _gtk_path_bar_down (GTK_PATH_BAR (priv->browse_path_bar)); } @@ -7817,7 +7825,7 @@ desktop_folder_handler (GtkFileChooserWidget *impl) static void search_shortcut_handler (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); if (priv->operation_mode == OPERATION_MODE_SEARCH) { @@ -7842,14 +7850,16 @@ recent_shortcut_handler (GtkFileChooserWidget *impl) static void places_shortcut_handler (GtkFileChooserWidget *impl) { - gtk_widget_child_focus (impl->priv->places_sidebar, GTK_DIR_LEFT); + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); + + gtk_widget_child_focus (priv->places_sidebar, GTK_DIR_LEFT); } static void quick_bookmark_handler (GtkFileChooserWidget *impl, gint bookmark_index) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GFile *file; file = gtk_places_sidebar_get_nth_bookmark (GTK_PLACES_SIDEBAR (priv->places_sidebar), bookmark_index); @@ -7864,7 +7874,7 @@ quick_bookmark_handler (GtkFileChooserWidget *impl, static void show_hidden_handler (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_object_set (impl, "show-hidden", !priv->show_hidden, NULL); } @@ -8339,27 +8349,28 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) static void post_process_ui (GtkFileChooserWidget *impl) { + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkTreeSelection *selection; GtkCellRenderer *cell; GList *cells; GFile *file; /* Setup file list treeview */ - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->priv->browse_files_tree_view)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); gtk_tree_selection_set_select_function (selection, list_select_func, impl, NULL); - gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (impl->priv->browse_files_tree_view), + gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (priv->browse_files_tree_view), GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_drag_source_add_uri_targets (impl->priv->browse_files_tree_view); + gtk_drag_source_add_uri_targets (priv->browse_files_tree_view); - gtk_drag_dest_set (impl->priv->browse_files_tree_view, + gtk_drag_dest_set (priv->browse_files_tree_view, GTK_DEST_DEFAULT_ALL, NULL, GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_drag_dest_add_uri_targets (impl->priv->browse_files_tree_view); + gtk_drag_dest_add_uri_targets (priv->browse_files_tree_view); /* File browser treemodel columns are shared between GtkFileChooser implementations, * so we don't set cell renderer attributes in GtkBuilder, but rather keep that @@ -8373,7 +8384,7 @@ post_process_ui (GtkFileChooserWidget *impl) * as an 'internal-child', then we could configure it in GtkBuilder * instead of hard coding it here. */ - cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (impl->priv->filter_combo)); + cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->filter_combo)); g_assert (cells); cell = cells->data; g_object_set (G_OBJECT (cell), @@ -8383,9 +8394,9 @@ post_process_ui (GtkFileChooserWidget *impl) g_list_free (cells); /* Set the GtkPathBar file system backend */ - _gtk_path_bar_set_file_system (GTK_PATH_BAR (impl->priv->browse_path_bar), impl->priv->file_system); + _gtk_path_bar_set_file_system (GTK_PATH_BAR (priv->browse_path_bar), priv->file_system); file = g_file_new_for_path ("/"); - _gtk_path_bar_set_file (GTK_PATH_BAR (impl->priv->browse_path_bar), file, FALSE); + _gtk_path_bar_set_file (GTK_PATH_BAR (priv->browse_path_bar), file, FALSE); g_object_unref (file); /* Set the fixed size icon renderer, this requires @@ -8393,20 +8404,20 @@ post_process_ui (GtkFileChooserWidget *impl) */ set_icon_cell_renderer_fixed_size (impl); - gtk_popover_set_default_widget (GTK_POPOVER (impl->priv->new_folder_popover), impl->priv->new_folder_create_button); - gtk_popover_set_default_widget (GTK_POPOVER (impl->priv->rename_file_popover), impl->priv->rename_file_rename_button); - gtk_popover_set_relative_to (GTK_POPOVER (impl->priv->rename_file_popover), impl->priv->browse_files_tree_view); + gtk_popover_set_default_widget (GTK_POPOVER (priv->new_folder_popover), priv->new_folder_create_button); + gtk_popover_set_default_widget (GTK_POPOVER (priv->rename_file_popover), priv->rename_file_rename_button); + gtk_popover_set_relative_to (GTK_POPOVER (priv->rename_file_popover), priv->browse_files_tree_view); add_actions (impl); - gtk_search_entry_set_key_capture_widget (GTK_SEARCH_ENTRY (impl->priv->search_entry), impl->priv->search_entry); + gtk_search_entry_set_key_capture_widget (GTK_SEARCH_ENTRY (priv->search_entry), priv->search_entry); } void gtk_file_chooser_widget_set_save_entry (GtkFileChooserWidget *impl, GtkWidget *entry) { - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); g_return_if_fail (GTK_IS_FILE_CHOOSER_WIDGET (impl)); g_return_if_fail (entry == NULL || GTK_IS_FILE_CHOOSER_ENTRY (entry)); @@ -8424,15 +8435,12 @@ gtk_file_chooser_widget_set_save_entry (GtkFileChooserWidget *impl, static void gtk_file_chooser_widget_init (GtkFileChooserWidget *impl) { - GtkFileChooserWidgetPrivate *priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); profile_start ("start", NULL); #ifdef PROFILE_FILE_CHOOSER access ("MARK: *** CREATE FILE CHOOSER", F_OK); #endif - impl->priv = gtk_file_chooser_widget_get_instance_private (impl); - priv = impl->priv; - gtk_widget_set_has_surface (GTK_WIDGET (impl), FALSE); priv->local_only = FALSE; @@ -8501,7 +8509,7 @@ gtk_file_chooser_widget_add_choice (GtkFileChooser *chooser, const char **option_labels) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *widget; if (priv->choices == NULL) @@ -8553,7 +8561,7 @@ gtk_file_chooser_widget_remove_choice (GtkFileChooser *chooser, const char *id) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *widget; if (priv->choices == NULL) @@ -8578,7 +8586,7 @@ gtk_file_chooser_widget_set_choice (GtkFileChooser *chooser, const char *option) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *widget; if (priv->choices == NULL) @@ -8597,7 +8605,7 @@ gtk_file_chooser_widget_get_choice (GtkFileChooser *chooser, const char *id) { GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser); - GtkFileChooserWidgetPrivate *priv = impl->priv; + GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); GtkWidget *widget; if (priv->choices == NULL)