[gedit/wip/redesign2] Make remove_items explicitly available



commit 2915ab51bf5b602579c74e9d7fb186a0063ccd59
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Jan 2 14:35:22 2014 +0100

    Make remove_items explicitly available

 gedit/gedit-menu.c |   54 ++++++++++++++++++++++++++--------------------------
 gedit/gedit-menu.h |    2 +
 2 files changed, 29 insertions(+), 27 deletions(-)
---
diff --git a/gedit/gedit-menu.c b/gedit/gedit-menu.c
index c46eb8d..32bdcd6 100644
--- a/gedit/gedit-menu.c
+++ b/gedit/gedit-menu.c
@@ -41,33 +41,6 @@ enum
 G_DEFINE_TYPE_WITH_PRIVATE (GeditMenu, gedit_menu, G_TYPE_OBJECT)
 
 static void
-gedit_menu_remove_items (GeditMenu *menu)
-{
-       GeditMenuPrivate *priv;
-       gint i, n_items;
-
-       priv = gedit_menu_get_instance_private (menu);
-
-       n_items = g_menu_model_get_n_items (priv->model);
-       i = 0;
-       while (i < n_items)
-       {
-               guint id = 0;
-
-               if (g_menu_model_get_item_attribute (priv->model, i, "gedit-merge-id", "u", &id) &&
-                   id == priv->merge_id)
-               {
-                       g_menu_remove (G_MENU (priv->model), i);
-                       n_items--;
-               }
-               else
-               {
-                       i++;
-               }
-       }
-}
-
-static void
 gedit_menu_dispose (GObject *object)
 {
        GeditMenu *menu = GEDIT_MENU (object);
@@ -178,4 +151,31 @@ gedit_menu_add_menu_item (GeditMenu *menu,
        }
 }
 
+void
+gedit_menu_remove_items (GeditMenu *menu)
+{
+       GeditMenuPrivate *priv;
+       gint i, n_items;
+
+       priv = gedit_menu_get_instance_private (menu);
+
+       n_items = g_menu_model_get_n_items (priv->model);
+       i = 0;
+       while (i < n_items)
+       {
+               guint id = 0;
+
+               if (g_menu_model_get_item_attribute (priv->model, i, "gedit-merge-id", "u", &id) &&
+                   id == priv->merge_id)
+               {
+                       g_menu_remove (G_MENU (priv->model), i);
+                       n_items--;
+               }
+               else
+               {
+                       i++;
+               }
+       }
+}
+
 /* ex:set ts=8 noet: */
diff --git a/gedit/gedit-menu.h b/gedit/gedit-menu.h
index 0952af2..5107bc3 100644
--- a/gedit/gedit-menu.h
+++ b/gedit/gedit-menu.h
@@ -55,6 +55,8 @@ GeditMenu                *_gedit_menu_new                (GMenuModel  *model);
 void                      gedit_menu_add_menu_item       (GeditMenu   *menu,
                                                           GMenuItem   *item);
 
+void                      gedit_menu_remove_items        (GeditMenu   *menu);
+
 G_END_DECLS
 
 #endif /* __GEDIT_MENU_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]