Commit 39d5bba2 authored by Alexander Schwinn's avatar Alexander Schwinn
Browse files

Remove unused deprecated GtkUiManager (Bug #16654)

parent 4ffe781a
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
@@ -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)
{
+0 −65
Original line number Diff line number Diff line
@@ -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);
}



+0 −8
Original line number Diff line number Diff line
@@ -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__ */
+0 −39
Original line number Diff line number Diff line
@@ -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)
+0 −58
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ enum
  PROP_0,
  PROP_CURRENT_DIRECTORY,
  PROP_SELECTED_FILES,
  PROP_UI_MANAGER,
  PROP_WIDGET,
  PROP_SELECT_FILES_CLOSURE,
  N_PROPERTIES
@@ -95,9 +94,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,
@@ -173,8 +169,6 @@ struct _ThunarLauncher
  ThunarFile             *current_directory;
  GList                  *selected_files;

  GtkUIManager           *ui_manager;

  gint                    n_selected_files;
  gint                    n_selected_directories;
  gint                    n_selected_executables;
@@ -307,10 +301,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);
}
@@ -322,8 +312,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;
}


@@ -356,7 +344,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 */
@@ -401,10 +388,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;
@@ -431,10 +414,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;
@@ -591,43 +570,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.
Loading