From ed94a6b80dc239dee9a4ced428c71d66f67e7063 Mon Sep 17 00:00:00 2001 From: Alexander Schwinn <alexxcons@xfce.org> Date: Sat, 16 May 2020 22:03:38 +0200 Subject: [PATCH] Remove unused deprecated GtkUiManager (Issue #293) --- thunar/thunar-abstract-icon-view.c | 40 --------------- thunar/thunar-component.c | 65 ------------------------- thunar/thunar-component.h | 8 --- thunar/thunar-details-view.c | 39 --------------- thunar/thunar-launcher.c | 58 ---------------------- thunar/thunar-renamer-dialog.c | 5 -- thunar/thunar-shortcuts-pane.c | 55 --------------------- thunar/thunar-standard-view.c | 78 ------------------------------ thunar/thunar-standard-view.h | 10 ---- thunar/thunar-tree-pane.c | 13 ----- thunar/thunar-window.c | 39 +-------------- 11 files changed, 1 insertion(+), 409 deletions(-) diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c index b89241014..6b111a731 100644 --- a/thunar/thunar-abstract-icon-view.c +++ b/thunar/thunar-abstract-icon-view.c @@ -36,10 +36,6 @@ static void thunar_abstract_icon_view_style_set (GtkWidget *widget, GtkStyle *previous_style); -static void thunar_abstract_icon_view_connect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager); -static void thunar_abstract_icon_view_disconnect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager); static GList *thunar_abstract_icon_view_get_selected_items (ThunarStandardView *standard_view); static void thunar_abstract_icon_view_select_all (ThunarStandardView *standard_view); static void thunar_abstract_icon_view_unselect_all (ThunarStandardView *standard_view); @@ -102,9 +98,6 @@ static void thunar_abstract_icon_view_action_sort_descending(ThunarStand struct _ThunarAbstractIconViewPrivate { - /* the UI manager merge id for the abstract icon view */ - gint ui_merge_id; - GtkSortType sort_order; gint sort_column; @@ -150,8 +143,6 @@ thunar_abstract_icon_view_class_init (ThunarAbstractIconViewClass *klass) gtkwidget_class->style_set = thunar_abstract_icon_view_style_set; thunarstandard_view_class = THUNAR_STANDARD_VIEW_CLASS (klass); - thunarstandard_view_class->connect_ui_manager = thunar_abstract_icon_view_connect_ui_manager; - thunarstandard_view_class->disconnect_ui_manager = thunar_abstract_icon_view_disconnect_ui_manager; thunarstandard_view_class->get_selected_items = thunar_abstract_icon_view_get_selected_items; thunarstandard_view_class->select_all = thunar_abstract_icon_view_select_all; thunarstandard_view_class->unselect_all = thunar_abstract_icon_view_unselect_all; @@ -269,37 +260,6 @@ thunar_abstract_icon_view_style_set (GtkWidget *widget, -static void -thunar_abstract_icon_view_connect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager) -{ - ThunarAbstractIconView *abstract_icon_view = THUNAR_ABSTRACT_ICON_VIEW (standard_view); - GError *error = NULL; - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - abstract_icon_view->priv->ui_merge_id = gtk_ui_manager_add_ui_from_string (ui_manager, thunar_abstract_icon_view_ui, - thunar_abstract_icon_view_ui_length, &error); -G_GNUC_END_IGNORE_DEPRECATIONS - if (G_UNLIKELY (abstract_icon_view->priv->ui_merge_id == 0)) - { - g_error ("Failed to merge ThunarAbstractIconView menus: %s", error->message); - g_error_free (error); - } -} - - - -static void -thunar_abstract_icon_view_disconnect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager) -{ -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_ui_manager_remove_ui (ui_manager, THUNAR_ABSTRACT_ICON_VIEW (standard_view)->priv->ui_merge_id); -G_GNUC_END_IGNORE_DEPRECATIONS -} - - - static GList* thunar_abstract_icon_view_get_selected_items (ThunarStandardView *standard_view) { diff --git a/thunar/thunar-component.c b/thunar/thunar-component.c index 29cd68497..126cbecf9 100644 --- a/thunar/thunar-component.c +++ b/thunar/thunar-component.c @@ -85,22 +85,6 @@ thunar_component_class_init (gpointer klass) "selected-files", THUNARX_TYPE_FILE_INFO_LIST, EXO_PARAM_READWRITE)); - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - /** - * ThunarComponent:ui-manager: - * - * The UI manager used by the surrounding #ThunarWindow. The - * #ThunarComponent implementations may connect additional actions - * to the UI manager. - **/ - g_object_interface_install_property (klass, - g_param_spec_object ("ui-manager", - "ui-manager", - "ui-manager", - GTK_TYPE_UI_MANAGER, - EXO_PARAM_READWRITE)); -G_GNUC_END_IGNORE_DEPRECATIONS } @@ -160,52 +144,3 @@ thunar_component_restore_selection (ThunarComponent *component) thunar_component_set_selected_files (component, selected_files); thunar_g_file_list_free (selected_files); } - - - -/** - * thunar_component_get_ui_manager: - * @component : a #ThunarComponent instance. - * - * Returns the #GtkUIManager associated with @component or - * %NULL if @component has no #GtkUIManager associated with - * it. - * - * Return value: the #GtkUIManager associated with @component - * or %NULL. - **/ -GtkUIManager* -thunar_component_get_ui_manager (ThunarComponent *component) -{ - _thunar_return_val_if_fail (THUNAR_IS_COMPONENT (component), NULL); - return (*THUNAR_COMPONENT_GET_IFACE (component)->get_ui_manager) (component); -} - - - -/** - * thunar_component_set_ui_manager: - * @component : a #ThunarComponent instance. - * @ui_manager : a #GtkUIManager or %NULL. - * - * Installs a new #GtkUIManager for @component or resets the ::ui-manager - * property. - * - * Implementations of the #ThunarComponent interface must first disconnect - * from any previously set #GtkUIManager and then connect to the - * @ui_manager if not %NULL. - **/ -void -thunar_component_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager) -{ - _thunar_return_if_fail (THUNAR_IS_COMPONENT (component)); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - _thunar_return_if_fail (ui_manager == NULL || GTK_IS_UI_MANAGER (ui_manager)); -G_GNUC_END_IGNORE_DEPRECATIONS - (*THUNAR_COMPONENT_GET_IFACE (component)->set_ui_manager) (component, ui_manager); -} - - - - diff --git a/thunar/thunar-component.h b/thunar/thunar-component.h index 17fe7056a..abbb342d6 100644 --- a/thunar/thunar-component.h +++ b/thunar/thunar-component.h @@ -40,10 +40,6 @@ struct _ThunarComponentIface GList *(*get_selected_files) (ThunarComponent *component); void (*set_selected_files) (ThunarComponent *component, GList *selected_files); - - GtkUIManager *(*get_ui_manager) (ThunarComponent *component); - void (*set_ui_manager) (ThunarComponent *component, - GtkUIManager *ui_manager); }; GType thunar_component_get_type (void) G_GNUC_CONST; @@ -54,10 +50,6 @@ void thunar_component_set_selected_files (ThunarComponent *component, void thunar_component_restore_selection (ThunarComponent *component); -GtkUIManager *thunar_component_get_ui_manager (ThunarComponent *component); -void thunar_component_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager); - G_END_DECLS; #endif /* !__THUNAR_COMPONENT_H__ */ diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c index 66a4fba1d..cc61c1495 100644 --- a/thunar/thunar-details-view.c +++ b/thunar/thunar-details-view.c @@ -53,10 +53,6 @@ static void thunar_details_view_set_property (GObject const GValue *value, GParamSpec *pspec); static AtkObject *thunar_details_view_get_accessible (GtkWidget *widget); -static void thunar_details_view_connect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager); -static void thunar_details_view_disconnect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager); static GList *thunar_details_view_get_selected_items (ThunarStandardView *standard_view); static void thunar_details_view_select_all (ThunarStandardView *standard_view); static void thunar_details_view_unselect_all (ThunarStandardView *standard_view); @@ -136,9 +132,6 @@ struct _ThunarDetailsView /* whether to use fixed column widths */ gboolean fixed_columns; - /* the UI manager merge id for the details view */ - guint ui_merge_id; - /* whether the most recent item activation used a mouse button press */ gboolean button_pressed; }; @@ -174,8 +167,6 @@ thunar_details_view_class_init (ThunarDetailsViewClass *klass) gtkwidget_class->get_accessible = thunar_details_view_get_accessible; thunarstandard_view_class = THUNAR_STANDARD_VIEW_CLASS (klass); - thunarstandard_view_class->connect_ui_manager = thunar_details_view_connect_ui_manager; - thunarstandard_view_class->disconnect_ui_manager = thunar_details_view_disconnect_ui_manager; thunarstandard_view_class->get_selected_items = thunar_details_view_get_selected_items; thunarstandard_view_class->select_all = thunar_details_view_select_all; thunarstandard_view_class->unselect_all = thunar_details_view_unselect_all; @@ -421,36 +412,6 @@ thunar_details_view_get_accessible (GtkWidget *widget) } -static void -thunar_details_view_connect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager) -{ - ThunarDetailsView *details_view = THUNAR_DETAILS_VIEW (standard_view); - GError *error = NULL; - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - details_view->ui_merge_id = gtk_ui_manager_add_ui_from_string (ui_manager, thunar_details_view_ui, - thunar_details_view_ui_length, &error); -G_GNUC_END_IGNORE_DEPRECATIONS - if (G_UNLIKELY (details_view->ui_merge_id == 0)) - { - g_error ("Failed to merge ThunarDetailsView menus: %s", error->message); - g_error_free (error); - } -} - - - -static void -thunar_details_view_disconnect_ui_manager (ThunarStandardView *standard_view, - GtkUIManager *ui_manager) -{ -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_ui_manager_remove_ui (ui_manager, THUNAR_DETAILS_VIEW (standard_view)->ui_merge_id); -G_GNUC_END_IGNORE_DEPRECATIONS -} - - static GList* thunar_details_view_get_selected_items (ThunarStandardView *standard_view) diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c index e42975b4b..7d7ebd242 100644 --- a/thunar/thunar-launcher.c +++ b/thunar/thunar-launcher.c @@ -68,7 +68,6 @@ enum PROP_0, PROP_CURRENT_DIRECTORY, PROP_SELECTED_FILES, - PROP_UI_MANAGER, PROP_WIDGET, PROP_SELECT_FILES_CLOSURE, N_PROPERTIES @@ -94,9 +93,6 @@ static void thunar_launcher_set_current_directory (Thuna static GList *thunar_launcher_get_selected_files (ThunarComponent *component); static void thunar_launcher_set_selected_files (ThunarComponent *component, GList *selected_files); -static GtkUIManager *thunar_launcher_get_ui_manager (ThunarComponent *component); -static void thunar_launcher_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager); static void thunar_launcher_execute_files (ThunarLauncher *launcher, GList *files); static void thunar_launcher_open_file (ThunarLauncher *launcher, @@ -172,8 +168,6 @@ struct _ThunarLauncher ThunarFile *current_directory; GList *selected_files; - GtkUIManager *ui_manager; - gint n_selected_files; gint n_selected_directories; gint n_selected_executables; @@ -306,10 +300,6 @@ thunar_launcher_class_init (ThunarLauncherClass *klass) g_param_spec_override ("selected-files", g_object_interface_find_property (g_iface, "selected-files")); - launcher_props[PROP_UI_MANAGER] = - g_param_spec_override ("ui-manager", - g_object_interface_find_property (g_iface, "ui-manager")); - /* install properties */ g_object_class_install_properties (gobject_class, N_PROPERTIES, launcher_props); } @@ -321,8 +311,6 @@ thunar_launcher_component_init (ThunarComponentIface *iface) { iface->get_selected_files = thunar_launcher_get_selected_files; iface->set_selected_files = thunar_launcher_set_selected_files; - iface->get_ui_manager = thunar_launcher_get_ui_manager; - iface->set_ui_manager = thunar_launcher_set_ui_manager; } @@ -355,7 +343,6 @@ thunar_launcher_dispose (GObject *object) /* reset our properties */ thunar_navigator_set_current_directory (THUNAR_NAVIGATOR (launcher), NULL); - thunar_component_set_ui_manager (THUNAR_COMPONENT (launcher), NULL); thunar_launcher_set_widget (THUNAR_LAUNCHER (launcher), NULL); /* disconnect from the currently selected files */ @@ -400,10 +387,6 @@ thunar_launcher_get_property (GObject *object, g_value_set_boxed (value, thunar_component_get_selected_files (THUNAR_COMPONENT (object))); break; - case PROP_UI_MANAGER: - g_value_set_object (value, thunar_component_get_ui_manager (THUNAR_COMPONENT (object))); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -430,10 +413,6 @@ thunar_launcher_set_property (GObject *object, thunar_component_set_selected_files (THUNAR_COMPONENT (object), g_value_get_boxed (value)); break; - case PROP_UI_MANAGER: - thunar_component_set_ui_manager (THUNAR_COMPONENT (object), g_value_get_object (value)); - break; - case PROP_WIDGET: thunar_launcher_set_widget (launcher, g_value_get_object (value)); break; @@ -590,43 +569,6 @@ thunar_launcher_set_selected_files (ThunarComponent *component, -static GtkUIManager* -thunar_launcher_get_ui_manager (ThunarComponent *component) -{ - return THUNAR_LAUNCHER (component)->ui_manager; -} - - - -static void -thunar_launcher_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager) -{ - ThunarLauncher *launcher = THUNAR_LAUNCHER (component); - - /* disconnect from the previous UI manager */ - if (G_UNLIKELY (launcher->ui_manager != NULL)) - { - /* drop the reference on the previous UI manager */ - g_object_unref (G_OBJECT (launcher->ui_manager)); - } - - /* activate the new UI manager */ - launcher->ui_manager = ui_manager; - - /* connect to the new UI manager */ - if (G_LIKELY (ui_manager != NULL)) - { - /* we keep a reference on the new manager */ - g_object_ref (G_OBJECT (ui_manager)); - } - - /* notify listeners */ - g_object_notify_by_pspec (G_OBJECT (launcher), launcher_props[PROP_UI_MANAGER]); -} - - - /** * thunar_launcher_set_widget: * @launcher : a #ThunarLauncher. diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c index f76e77e89..0e4fb86c0 100644 --- a/thunar/thunar-renamer-dialog.c +++ b/thunar/thunar-renamer-dialog.c @@ -164,8 +164,6 @@ struct _ThunarRenamerDialog ThunarLauncher *launcher; - GtkUIManager *ui_manager; - GtkWidget *cancel_button; GtkWidget *close_button; @@ -368,7 +366,6 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog) /* setup the launcher support for this dialog */ renamer_dialog->launcher = g_object_new (THUNAR_TYPE_LAUNCHER, "widget", GTK_WIDGET (renamer_dialog), NULL); - thunar_component_set_ui_manager (THUNAR_COMPONENT (renamer_dialog->launcher), renamer_dialog->ui_manager); exo_binding_new (G_OBJECT (renamer_dialog), "selected-files", G_OBJECT (renamer_dialog->launcher), "selected-files"); /* add the toolbar to the dialog */ @@ -643,8 +640,6 @@ thunar_renamer_dialog_finalize (GObject *object) /* release the launcher support */ g_object_unref (G_OBJECT (renamer_dialog->launcher)); - g_object_unref (G_OBJECT (renamer_dialog->ui_manager)); - /* release our bulk rename model */ g_object_unref (G_OBJECT (renamer_dialog->model)); diff --git a/thunar/thunar-shortcuts-pane.c b/thunar/thunar-shortcuts-pane.c index 11ac543b6..af22391d1 100644 --- a/thunar/thunar-shortcuts-pane.c +++ b/thunar/thunar-shortcuts-pane.c @@ -37,7 +37,6 @@ enum PROP_CURRENT_DIRECTORY, PROP_SELECTED_FILES, PROP_SHOW_HIDDEN, - PROP_UI_MANAGER, }; @@ -61,9 +60,6 @@ static void thunar_shortcuts_pane_set_current_directory (ThunarNavigato static GList *thunar_shortcuts_pane_get_selected_files (ThunarComponent *component); static void thunar_shortcuts_pane_set_selected_files (ThunarComponent *component, GList *selected_files); -static GtkUIManager *thunar_shortcuts_pane_get_ui_manager (ThunarComponent *component); -static void thunar_shortcuts_pane_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager); static void thunar_shortcuts_pane_show_shortcuts_view_padding (GtkWidget *widget); static void thunar_shortcuts_pane_hide_shortcuts_view_padding (GtkWidget *widget); @@ -81,8 +77,6 @@ struct _ThunarShortcutsPane ThunarFile *current_directory; GList *selected_files; - GtkUIManager *ui_manager; - GtkWidget *view; guint idle_select_directory; @@ -113,7 +107,6 @@ thunar_shortcuts_pane_class_init (ThunarShortcutsPaneClass *klass) /* override ThunarComponent's properties */ g_object_class_override_property (gobject_class, PROP_SELECTED_FILES, "selected-files"); - g_object_class_override_property (gobject_class, PROP_UI_MANAGER, "ui-manager"); /* override ThunarSidePane's properties */ g_object_class_override_property (gobject_class, PROP_SHOW_HIDDEN, "show-hidden"); @@ -126,8 +119,6 @@ thunar_shortcuts_pane_component_init (ThunarComponentIface *iface) { iface->get_selected_files = thunar_shortcuts_pane_get_selected_files; iface->set_selected_files = thunar_shortcuts_pane_set_selected_files; - iface->get_ui_manager = thunar_shortcuts_pane_get_ui_manager; - iface->set_ui_manager = thunar_shortcuts_pane_set_ui_manager; } @@ -191,7 +182,6 @@ thunar_shortcuts_pane_dispose (GObject *object) thunar_navigator_set_current_directory (THUNAR_NAVIGATOR (shortcuts_pane), NULL); thunar_component_set_selected_files (THUNAR_COMPONENT (shortcuts_pane), NULL); - thunar_component_set_ui_manager (THUNAR_COMPONENT (shortcuts_pane), NULL); (*G_OBJECT_CLASS (thunar_shortcuts_pane_parent_class)->dispose) (object); } @@ -226,10 +216,6 @@ thunar_shortcuts_pane_get_property (GObject *object, g_value_set_boolean (value, thunar_side_pane_get_show_hidden (THUNAR_SIDE_PANE (object))); break; - case PROP_UI_MANAGER: - g_value_set_object (value, thunar_component_get_ui_manager (THUNAR_COMPONENT (object))); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -258,10 +244,6 @@ thunar_shortcuts_pane_set_property (GObject *object, thunar_side_pane_set_show_hidden (THUNAR_SIDE_PANE (object), g_value_get_boolean (value)); break; - case PROP_UI_MANAGER: - thunar_component_set_ui_manager (THUNAR_COMPONENT (object), g_value_get_object (value)); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -362,43 +344,6 @@ thunar_shortcuts_pane_set_selected_files (ThunarComponent *component, -static GtkUIManager* -thunar_shortcuts_pane_get_ui_manager (ThunarComponent *component) -{ - return THUNAR_SHORTCUTS_PANE (component)->ui_manager; -} - - - -static void -thunar_shortcuts_pane_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager) -{ - ThunarShortcutsPane *shortcuts_pane = THUNAR_SHORTCUTS_PANE (component); - - /* disconnect from the previous UI manager */ - if (G_UNLIKELY (shortcuts_pane->ui_manager != NULL)) - { - /* drop our reference on the previous UI manager */ - g_object_unref (G_OBJECT (shortcuts_pane->ui_manager)); - } - - /* activate the new UI manager */ - shortcuts_pane->ui_manager = ui_manager; - - /* connect to the new UI manager */ - if (G_LIKELY (ui_manager != NULL)) - { - /* we keep a reference on the new manager */ - g_object_ref (G_OBJECT (ui_manager)); - } - - /* notify listeners */ - g_object_notify (G_OBJECT (shortcuts_pane), "ui-manager"); -} - - - /** * thunar_shortcuts_pane_add_shortcut: * @shortcuts_pane : Instance of a #ThunarShortcutsPane diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 34967fec8..753493228 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -70,7 +70,6 @@ enum PROP_SELECTED_FILES, PROP_SHOW_HIDDEN, PROP_STATUSBAR_TEXT, - PROP_UI_MANAGER, PROP_ZOOM_LEVEL, PROP_THUMBNAIL_DRAW_FRAMES, PROP_ACCEL_GROUP, @@ -118,9 +117,6 @@ static gboolean thunar_standard_view_draw (Gtk static GList *thunar_standard_view_get_selected_files_component (ThunarComponent *component); static void thunar_standard_view_set_selected_files_component (ThunarComponent *component, GList *selected_files); -static GtkUIManager *thunar_standard_view_get_ui_manager (ThunarComponent *component); -static void thunar_standard_view_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager); static ThunarFile *thunar_standard_view_get_current_directory (ThunarNavigator *navigator); static void thunar_standard_view_set_current_directory (ThunarNavigator *navigator, ThunarFile *current_directory); @@ -397,8 +393,6 @@ thunar_standard_view_class_init (ThunarStandardViewClass *klass) gtkwidget_class->draw = thunar_standard_view_draw; xfce_gtk_translate_action_entries (thunar_standard_view_action_entries, G_N_ELEMENTS (thunar_standard_view_action_entries)); - klass->connect_ui_manager = (gpointer) exo_noop; - klass->disconnect_ui_manager = (gpointer) exo_noop; /** * ThunarStandardView:loading: @@ -461,10 +455,6 @@ thunar_standard_view_class_init (ThunarStandardViewClass *klass) g_param_spec_override ("selected-files", g_object_interface_find_property (g_iface, "selected-files")); - standard_view_props[PROP_UI_MANAGER] = - g_param_spec_override ("ui-manager", - g_object_interface_find_property (g_iface, "ui-manager")); - /* override ThunarNavigator's properties */ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR); standard_view_props[PROP_CURRENT_DIRECTORY] = @@ -524,8 +514,6 @@ thunar_standard_view_component_init (ThunarComponentIface *iface) { iface->get_selected_files = thunar_standard_view_get_selected_files_component; iface->set_selected_files = thunar_standard_view_set_selected_files_component; - iface->get_ui_manager = thunar_standard_view_get_ui_manager; - iface->set_ui_manager = thunar_standard_view_set_ui_manager; } @@ -747,9 +735,6 @@ thunar_standard_view_dispose (GObject *object) standard_view->priv->drag_timer_event = NULL; } - /* reset the UI manager property */ - thunar_component_set_ui_manager (THUNAR_COMPONENT (standard_view), NULL); - /* disconnect from file */ if (standard_view->priv->current_directory != NULL) { @@ -889,10 +874,6 @@ thunar_standard_view_get_property (GObject *object, g_value_set_static_string (value, thunar_view_get_statusbar_text (THUNAR_VIEW (object))); break; - case PROP_UI_MANAGER: - g_value_set_object (value, thunar_component_get_ui_manager (THUNAR_COMPONENT (object))); - break; - case PROP_ZOOM_LEVEL: g_value_set_enum (value, thunar_view_get_zoom_level (THUNAR_VIEW (object))); break; @@ -936,10 +917,6 @@ thunar_standard_view_set_property (GObject *object, thunar_view_set_show_hidden (THUNAR_VIEW (object), g_value_get_boolean (value)); break; - case PROP_UI_MANAGER: - thunar_component_set_ui_manager (THUNAR_COMPONENT (object), g_value_get_object (value)); - break; - case PROP_ZOOM_LEVEL: thunar_view_set_zoom_level (THUNAR_VIEW (object), g_value_get_enum (value)); break; @@ -1125,61 +1102,6 @@ thunar_standard_view_set_selected_files_component (ThunarComponent *component, -static GtkUIManager* -thunar_standard_view_get_ui_manager (ThunarComponent *component) -{ - return THUNAR_STANDARD_VIEW (component)->ui_manager; -} - - - -static void -thunar_standard_view_set_ui_manager (ThunarComponent *component, - GtkUIManager *ui_manager) -{ - ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (component); - - /* leave if nothing changed */ - if (standard_view->ui_manager == ui_manager) - return; - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - /* disconnect from the previous UI manager */ - if (G_LIKELY (standard_view->ui_manager != NULL)) - { - /* unmerge the ui controls from derived classes */ - (*THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->disconnect_ui_manager) (standard_view, standard_view->ui_manager); - - /* force update to remove all actions and proxies */ - gtk_ui_manager_ensure_update (standard_view->ui_manager); - - /* drop the reference on the previous UI manager */ - g_object_unref (G_OBJECT (standard_view->ui_manager)); - } - - /* apply the new setting */ - standard_view->ui_manager = ui_manager; - - /* connect to the new manager (if any) */ - if (G_LIKELY (ui_manager != NULL)) - { - /* we keep a reference on the new manager */ - g_object_ref (G_OBJECT (ui_manager)); - - /* merge the ui controls from derived classes */ - (*THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->connect_ui_manager) (standard_view, ui_manager); - - /* force update to avoid flickering */ - gtk_ui_manager_ensure_update (standard_view->ui_manager); - } - -G_GNUC_END_IGNORE_DEPRECATIONS - /* let others know that we have a new manager */ - g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_UI_MANAGER]); -} - - - static void thunar_standard_view_set_selected_files_view (ThunarView *view, GList *selected_files) diff --git a/thunar/thunar-standard-view.h b/thunar/thunar-standard-view.h index ebad31854..31cb44507 100644 --- a/thunar/thunar-standard-view.h +++ b/thunar/thunar-standard-view.h @@ -53,14 +53,6 @@ struct _ThunarStandardViewClass { GtkScrolledWindowClass __parent__; - /* Called by the ThunarStandardView class to let derived classes - * connect to and disconnect from the UI manager. - */ - void (*connect_ui_manager) (ThunarStandardView *standard_view, - GtkUIManager *ui_manager); - void (*disconnect_ui_manager) (ThunarStandardView *standard_view, - GtkUIManager *ui_manager); - /* Returns the list of currently selected GtkTreePath's, where * both the list and the items are owned by the caller. */ GList *(*get_selected_items) (ThunarStandardView *standard_view); @@ -145,8 +137,6 @@ struct _ThunarStandardView ThunarListModel *model; - GtkUIManager *ui_manager; - ThunarIconFactory *icon_factory; GtkCellRenderer *icon_renderer; GtkCellRenderer *name_renderer; diff --git a/thunar/thunar-tree-pane.c b/thunar/thunar-tree-pane.c index c1a9086b5..109336b6f 100644 --- a/thunar/thunar-tree-pane.c +++ b/thunar/thunar-tree-pane.c @@ -33,7 +33,6 @@ enum PROP_CURRENT_DIRECTORY, PROP_SELECTED_FILES, PROP_SHOW_HIDDEN, - PROP_UI_MANAGER, }; @@ -97,7 +96,6 @@ thunar_tree_pane_class_init (ThunarTreePaneClass *klass) /* override ThunarComponent's properties */ g_object_class_override_property (gobject_class, PROP_SELECTED_FILES, "selected-files"); - g_object_class_override_property (gobject_class, PROP_UI_MANAGER, "ui-manager"); /* override ThunarSidePane's properties */ g_object_class_override_property (gobject_class, PROP_SHOW_HIDDEN, "show-hidden"); @@ -110,8 +108,6 @@ thunar_tree_pane_component_init (ThunarComponentIface *iface) { iface->get_selected_files = (gpointer) exo_noop_null; iface->set_selected_files = (gpointer) exo_noop; - iface->get_ui_manager = (gpointer) exo_noop_null; - iface->set_ui_manager = (gpointer) exo_noop; } @@ -162,7 +158,6 @@ thunar_tree_pane_dispose (GObject *object) thunar_navigator_set_current_directory (THUNAR_NAVIGATOR (tree_pane), NULL); thunar_component_set_selected_files (THUNAR_COMPONENT (tree_pane), NULL); - thunar_component_set_ui_manager (THUNAR_COMPONENT (tree_pane), NULL); (*G_OBJECT_CLASS (thunar_tree_pane_parent_class)->dispose) (object); } @@ -189,10 +184,6 @@ thunar_tree_pane_get_property (GObject *object, g_value_set_boolean (value, thunar_side_pane_get_show_hidden (THUNAR_SIDE_PANE (object))); break; - case PROP_UI_MANAGER: - g_value_set_object (value, thunar_component_get_ui_manager (THUNAR_COMPONENT (object))); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -221,10 +212,6 @@ thunar_tree_pane_set_property (GObject *object, thunar_side_pane_set_show_hidden (THUNAR_SIDE_PANE (object), g_value_get_boolean (value)); break; - case PROP_UI_MANAGER: - thunar_component_set_ui_manager (THUNAR_COMPONENT (object), g_value_get_object (value)); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 2de054d4e..0fb09d289 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -69,7 +69,6 @@ enum { PROP_0, PROP_CURRENT_DIRECTORY, - PROP_UI_MANAGER, PROP_ZOOM_LEVEL, }; @@ -296,8 +295,6 @@ struct _ThunarWindow ThunarIconFactory *icon_factory; - GtkUIManager *ui_manager; - /* to be able to change folder on "device-pre-unmount" if required */ ThunarDeviceMonitor *device_monitor; @@ -460,23 +457,6 @@ thunar_window_class_init (ThunarWindowClass *klass) THUNAR_TYPE_FILE, EXO_PARAM_READWRITE)); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - /** - * ThunarWindow:ui-manager: - * - * The #GtkUIManager used for this #ThunarWindow. This property - * can only be read and is garantied to always contain a valid - * #GtkUIManager instance (thus it's never %NULL). - **/ - g_object_class_install_property (gobject_class, - PROP_UI_MANAGER, - g_param_spec_object ("ui-manager", - "ui-manager", - "ui-manager", - GTK_TYPE_UI_MANAGER, - EXO_PARAM_READABLE)); -G_GNUC_END_IGNORE_DEPRECATIONS - /** * ThunarWindow:zoom-level: * @@ -662,9 +642,6 @@ thunar_window_init (ThunarWindow *window) window->launcher = g_object_new (THUNAR_TYPE_LAUNCHER, "widget", GTK_WIDGET (window), "select-files-closure", window->select_files_closure, NULL); - window->ui_manager = gtk_ui_manager_new (); - gtk_ui_manager_add_ui_from_string (window->ui_manager, thunar_window_ui, thunar_window_ui_length, NULL); - exo_binding_new (G_OBJECT (window), "current-directory", G_OBJECT (window->launcher), "current-directory"); g_signal_connect_swapped (G_OBJECT (window->launcher), "change-directory", G_CALLBACK (thunar_window_set_current_directory), window); g_signal_connect_swapped (G_OBJECT (window->launcher), "open-new-tab", G_CALLBACK (thunar_window_notebook_insert), window); @@ -1229,10 +1206,6 @@ thunar_window_finalize (GObject *object) g_signal_handlers_disconnect_matched (window->device_monitor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, window); g_object_unref (window->device_monitor); - /* disconnect from the ui manager */ - g_signal_handlers_disconnect_matched (window->ui_manager, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, window); - g_object_unref (window->ui_manager); - g_object_unref (window->icon_factory); g_object_unref (window->launcher); @@ -1314,10 +1287,6 @@ thunar_window_get_property (GObject *object, g_value_set_object (value, thunar_window_get_current_directory (window)); break; - case PROP_UI_MANAGER: - g_value_set_object (value, window->ui_manager); - break; - case PROP_ZOOM_LEVEL: g_value_set_enum (value, window->zoom_level); break; @@ -1708,9 +1677,6 @@ thunar_window_notebook_switch_page (GtkWidget *notebook, if (window->view_type != G_TYPE_NONE) g_object_set (G_OBJECT (window->preferences), "last-view", g_type_name (window->view_type), NULL); - /* integrate the standard view action in the ui */ - thunar_component_set_ui_manager (THUNAR_COMPONENT (page), window->ui_manager); - /* connect to the new history */ history = thunar_standard_view_get_history (THUNAR_STANDARD_VIEW (window->view)); if (history != NULL) @@ -1719,7 +1685,7 @@ thunar_window_notebook_switch_page (GtkWidget *notebook, thunar_window_history_changed (window); } - /* update the actions */ + /* update the selection */ thunar_standard_view_selection_changed (THUNAR_STANDARD_VIEW (page)); gtk_widget_grab_focus (page); @@ -1813,9 +1779,6 @@ thunar_window_notebook_page_removed (GtkWidget *notebook, /* drop connected signals */ g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, window); - /* remove from the ui */ - thunar_component_set_ui_manager (THUNAR_COMPONENT (page), NULL); - n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)); if (n_pages == 0) { -- GitLab