[Xfce4-commits] <garcon:master> Add garcon_menu_item_get_uri().

Nick Schermer nick at xfce.org
Mon Aug 17 21:28:02 CEST 2009


Updating branch refs/heads/master
         to 833c813b070671bd374e59a3b1dfa715ea046d4f (commit)
       from 3aa1a130aaa47d0ad9c036fb430e7db675b8430c (commit)

commit 833c813b070671bd374e59a3b1dfa715ea046d4f
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Aug 17 21:26:24 2009 +0200

    Add garcon_menu_item_get_uri().
    
    Simple helper function that makes it easier to get the
    location of the desktop file. The uri is also valid
    in almost all GFile locations, so therefore no filename
    function.

 garcon/garcon-menu-item.c |    8 ++++++++
 garcon/garcon-menu-item.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/garcon/garcon-menu-item.c b/garcon/garcon-menu-item.c
index 6ab7d7d..62a4790 100644
--- a/garcon/garcon-menu-item.c
+++ b/garcon/garcon-menu-item.c
@@ -701,6 +701,14 @@ garcon_menu_item_get_file (GarconMenuItem *item)
 }
 
 
+gchar *
+garcon_menu_item_get_uri (GarconMenuItem *item)
+{
+  g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), NULL);
+  return g_file_get_uri (item->priv->file);
+}
+
+
 
 const gchar *
 garcon_menu_item_get_desktop_id (GarconMenuItem *item)
diff --git a/garcon/garcon-menu-item.h b/garcon/garcon-menu-item.h
index 2df197e..7dec619 100644
--- a/garcon/garcon-menu-item.h
+++ b/garcon/garcon-menu-item.h
@@ -51,6 +51,8 @@ GarconMenuItem *garcon_menu_item_new_for_uri                       (const gchar
 
 GFile          *garcon_menu_item_get_file                          (GarconMenuItem *item);
 
+gchar          *garcon_menu_item_get_uri                           (GarconMenuItem *item) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+
 const gchar    *garcon_menu_item_get_desktop_id                    (GarconMenuItem *item);
 void            garcon_menu_item_set_desktop_id                    (GarconMenuItem *item,
                                                                     const gchar    *desktop_id);



More information about the Xfce4-commits mailing list