[Xfce4-commits] [xfce/libxfce4ui] 01/01: Fix compiler warnings

noreply at xfce.org noreply at xfce.org
Mon Jan 13 23:45:29 CET 2020


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/libxfce4ui.

commit 82ead2335084235cb2881fe68c18bccc0e1b9d5b
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Jan 13 23:45:12 2020 +0100

    Fix compiler warnings
---
 libxfce4ui/xfce-gtk-extensions.c |  8 +++-----
 libxfce4ui/xfce-gtk-extensions.h | 36 ++++++++++++++++++------------------
 2 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/libxfce4ui/xfce-gtk-extensions.c b/libxfce4ui/xfce-gtk-extensions.c
index ad720ab..833fe45 100644
--- a/libxfce4ui/xfce-gtk-extensions.c
+++ b/libxfce4ui/xfce-gtk-extensions.c
@@ -324,12 +324,11 @@ xfce_widget_reparent (GtkWidget *widget,
  * xfce_icon_name_from_desktop_id:
  * @desktop_id : Name of the desktop file.
  *
- * Return value: %NULL on error, else the string, which should be freed using
- *               g_free() when no longer needed.
+ * Return value: %NULL on error, else the string value of the "Icon" property.
  *
  * Since: 4.16
  **/
-gchar *
+const gchar *
 xfce_icon_name_from_desktop_id (const gchar *desktop_id)
 {
     const gchar *icon_file;
@@ -372,7 +371,7 @@ xfce_icon_name_from_desktop_id (const gchar *desktop_id)
 GIcon *
 xfce_gicon_from_name (const gchar *name)
 {
-    gchar *icon_name = NULL;
+    const gchar *icon_name;
     GIcon *gicon;
     GtkIconInfo *icon_info;
 
@@ -380,7 +379,6 @@ xfce_gicon_from_name (const gchar *name)
     icon_name = xfce_icon_name_from_desktop_id (name);
     if (icon_name) {
         gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
-        g_free (icon_name);
     }
     else {
         gicon = g_themed_icon_new_with_default_fallbacks (name);
diff --git a/libxfce4ui/xfce-gtk-extensions.h b/libxfce4ui/xfce-gtk-extensions.h
index 7ee3810..cbc0af4 100644
--- a/libxfce4ui/xfce-gtk-extensions.h
+++ b/libxfce4ui/xfce-gtk-extensions.h
@@ -28,31 +28,31 @@
 
 G_BEGIN_DECLS
 
-GtkWidget *xfce_gtk_button_new_mixed               (const gchar        *stock_id,
-                                                    const gchar        *label) G_GNUC_MALLOC;
+GtkWidget   *xfce_gtk_button_new_mixed               (const gchar        *stock_id,
+                                                      const gchar        *label) G_GNUC_MALLOC;
 
-GtkWidget *xfce_gtk_frame_box_new                  (const gchar        *label,
-                                                    GtkWidget         **container_return) G_GNUC_MALLOC;
+GtkWidget   *xfce_gtk_frame_box_new                  (const gchar        *label,
+                                                      GtkWidget         **container_return) G_GNUC_MALLOC;
 
-GtkWidget *xfce_gtk_frame_box_new_with_content     (const gchar         *label,
-                                                    GtkWidget           *content) G_GNUC_MALLOC;
+GtkWidget   *xfce_gtk_frame_box_new_with_content     (const gchar         *label,
+                                                      GtkWidget           *content) G_GNUC_MALLOC;
 
-void       xfce_gtk_window_center_on_active_screen (GtkWindow           *window);
+void         xfce_gtk_window_center_on_active_screen (GtkWindow           *window);
 
-gboolean   xfce_gtk_menu_popup_until_mapped        (GtkMenu             *menu,
-                                                    GtkWidget           *parent_menu_shell,
-                                                    GtkWidget           *parent_menu_item,
-                                                    GtkMenuPositionFunc  func,
-                                                    gpointer             data,
-                                                    guint                button,
-                                                    guint32              activate_time);
+gboolean     xfce_gtk_menu_popup_until_mapped        (GtkMenu             *menu,
+                                                      GtkWidget           *parent_menu_shell,
+                                                      GtkWidget           *parent_menu_item,
+                                                      GtkMenuPositionFunc  func,
+                                                      gpointer             data,
+                                                      guint                button,
+                                                      guint32              activate_time);
 
-gboolean   xfce_widget_reparent                    (GtkWidget           *widget,
-                                                    GtkWidget           *new_parent);
+gboolean     xfce_widget_reparent                    (GtkWidget           *widget,
+                                                      GtkWidget           *new_parent);
 
-gchar     *xfce_icon_name_from_desktop_id          (const gchar         *desktop_id);
+const gchar *xfce_icon_name_from_desktop_id          (const gchar         *desktop_id);
 
-GIcon     *xfce_gicon_from_name                    (const gchar         *name);
+GIcon       *xfce_gicon_from_name                    (const gchar         *name);
 
 G_END_DECLS
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list