Ejemplo n.º 1
0
static GList*
exo_toolbars_editor_get_actions (ExoToolbarsEditor *editor,
                                 ExoToolbarsModel  *model)
{
  GtkAction *action;
  gchar    **actions;
  GList     *result = NULL;
  guint      n;

  actions = exo_toolbars_model_get_actions (model);
  if (G_LIKELY (actions != NULL))
    {
      for (n = 0; actions[n] != NULL; ++n)
        {
          action = _exo_toolbars_find_action (editor->priv->ui_manager, actions[n]);
          if (G_UNLIKELY (action == NULL))
            continue;

          if (!model_has_action (model, action))
            result = g_list_insert_sorted (result, action, compare_actions);
        }

      g_strfreev (actions);
    }

  return result;
}
Ejemplo n.º 2
0
static void
update_actions_list (EggToolbarEditor *editor)
{
  GList *l;

  if (editor->priv->actions_list)
    g_list_free (editor->priv->actions_list);

  /* Remove the already used items */
  editor->priv->actions_list = NULL;

  for (l = editor->priv->default_actions_list; l != NULL; l = l->next)
    {
      GtkAction *action = GTK_ACTION (l->data);

      if (!model_has_action (editor->priv->model, action))
        {
          editor->priv->actions_list = g_list_insert_sorted
		(editor->priv->actions_list, action, compare_actions);
        }
    }
}