[Xfce4-commits] <garcon:master> Change GarconMenu API to match GarcoMenuItem.

Nick Schermer nick at xfce.org
Sun Aug 16 18:06:13 CEST 2009


Updating branch refs/heads/master
         to f7a602518dd13a0b7f3f19505883f7d4b54843dd (commit)
       from ce9762d78694cc3636d3fe934f8d5ccf5f17a8cc (commit)

commit f7a602518dd13a0b7f3f19505883f7d4b54843dd
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Aug 16 18:03:55 2009 +0200

    Change GarconMenu API to match GarcoMenuItem.
    
    Use a GFile for garcon_menu_new() and a filename for
    garcon_menu_new_for_path(). This matches the API change
    in the pervious commit.

 garcon/garcon-menu.c |   55 +++++++++++++++++++++++++------------------------
 garcon/garcon-menu.h |    4 +-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/garcon/garcon-menu.c b/garcon/garcon-menu.c
index 93dee3b..0e41e24 100644
--- a/garcon/garcon-menu.c
+++ b/garcon/garcon-menu.c
@@ -332,8 +332,34 @@ garcon_menu_set_property (GObject      *object,
 }
 
 
+
 /**
  * garcon_menu_new:
+ * @file  : #GFile for the .menu file you want to load.
+ *
+ * Creates a new #GarconMenu for the .menu file referred to by @file.
+ * This operation only fails @file is invalid. To load the menu 
+ * tree from the file, you need to call garcon_menu_load() with the
+ * returned #GarconMenu. 
+ *
+ * The caller is responsible to destroy the returned #GarconMenu
+ * using g_object_unref().
+ *
+ * For more information about the usage @see garcon_menu_new().
+ *
+ * Return value: a new #GarconMenu for @file.
+ **/
+GarconMenu *
+garcon_menu_new (GFile *file)
+{
+  g_return_val_if_fail (G_IS_FILE (file), NULL);
+  return g_object_new (GARCON_TYPE_MENU, "file", file, NULL);
+}
+
+
+
+/**
+ * garcon_menu_new_for_path:
  * @filename : Path/URI of the .menu file you want to load.
  *
  * Creates a new #GarconMenu for the .menu file referred to by @filename.
@@ -358,7 +384,7 @@ garcon_menu_set_property (GObject      *object,
  * Return value: a new #GarconMenu for @filename.
  **/
 GarconMenu *
-garcon_menu_new (const gchar *filename)
+garcon_menu_new_for_path (const gchar *filename)
 {
   GarconMenu *menu;
   GFile      *file;
@@ -376,31 +402,6 @@ garcon_menu_new (const gchar *filename)
 
 
 /**
- * garcon_menu_new_for_file:
- * @file  : #GFile for the .menu file you want to load.
- *
- * Creates a new #GarconMenu for the .menu file referred to by @file.
- * This operation only fails @file is invalid. To load the menu 
- * tree from the file, you need to call garcon_menu_load() with the
- * returned #GarconMenu. 
- *
- * The caller is responsible to destroy the returned #GarconMenu
- * using g_object_unref().
- *
- * For more information about the usage @see garcon_menu_new().
- *
- * Return value: a new #GarconMenu for @file.
- **/
-GarconMenu *
-garcon_menu_new_for_file (GFile *file)
-{
-  g_return_val_if_fail (G_IS_FILE (file), NULL);
-  return g_object_new (GARCON_TYPE_MENU, "file", file, NULL);
-}
-
-
-
-/**
  * garcon_menu_new_applications:
  *
  * Creates a new #GarconMenu for the applications.menu file
@@ -428,7 +429,7 @@ garcon_menu_new_applications (void)
       if (G_UNLIKELY (filename != NULL))
         {
           file = g_file_new_for_unknown_input (filename, NULL);
-          menu = garcon_menu_new_for_file (file);
+          menu = garcon_menu_new (file);
           g_object_unref (file);
         }
 
diff --git a/garcon/garcon-menu.h b/garcon/garcon-menu.h
index bd8c096..0ab5c89 100644
--- a/garcon/garcon-menu.h
+++ b/garcon/garcon-menu.h
@@ -39,8 +39,8 @@ typedef struct _GarconMenu        GarconMenu;
 
 GType                garcon_menu_get_type           (void) G_GNUC_CONST;
 
-GarconMenu          *garcon_menu_new                (const gchar  *filename) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-GarconMenu          *garcon_menu_new_for_file       (GFile        *file) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+GarconMenu          *garcon_menu_new                (GFile        *file) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+GarconMenu          *garcon_menu_new_for_path       (const gchar  *filename) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 GarconMenu          *garcon_menu_new_applications   (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 gboolean             garcon_menu_load               (GarconMenu   *menu, 
                                                      GCancellable *cancellable,



More information about the Xfce4-commits mailing list