[gtk/wip/baedert/window-icons2: 10/10] window: Inline function into only caller



commit 713f1f49e00118677b33d37904b0505d7f837fe1
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 e9e93097a9..35aceba560 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4566,16 +4566,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;
 
@@ -4585,22 +4591,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]