[gtk] window: Inline function into only caller



commit 057144cfddebedd5ed7d4b4c2e5f169e3e6da287
Author: Timm Bäder <mail baedert org>
Date:   Sun Dec 30 07:22:44 2018 +0100

    window: Inline function into only caller

 gtk/gtkwindow.c | 32 +++++++++++---------------------
 1 file changed, 11 insertions(+), 21 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1f975d5739..38690e7e56 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4562,16 +4562,22 @@ gtk_window_realize_icon (GtkWindow *window)
     }
 }
 
-static GdkTexture *
-icon_from_name (const gchar *name,
-                gint         size)
+GdkTexture *
+gtk_window_get_icon_for_size (GtkWindow *window,
+                              int        size)
 {
+  const char *name;
   GtkIconInfo *info;
   GdkTexture *texture;
 
+  name = gtk_window_get_icon_name (window);
+
+  if (!name)
+    name = default_icon_name;
+
   info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
-                                    name, size,
-                                    GTK_ICON_LOOKUP_FORCE_SIZE);
+                                     name, size,
+                                     GTK_ICON_LOOKUP_FORCE_SIZE);
   if (info == NULL)
     return NULL;
 
@@ -4581,22 +4587,6 @@ icon_from_name (const gchar *name,
   return texture;
 }
 
-GdkTexture *
-gtk_window_get_icon_for_size (GtkWindow *window,
-                              int        size)
-{
-  const gchar *name;
-
-  name = gtk_window_get_icon_name (window);
-  if (name != NULL)
-    return icon_from_name (name, size);
-
-  if (default_icon_name != NULL)
-    return icon_from_name (default_icon_name, size);
-
-  return NULL;
-}
-
 static void
 gtk_window_unrealize_icon (GtkWindow *window)
 {


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