[gtk/wip/baedert/icontheme2] icontheme: Remove icon_info_load_pixbuf
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/icontheme2] icontheme: Remove icon_info_load_pixbuf
- Date: Sun, 1 Sep 2019 09:28:06 +0000 (UTC)
commit 91a37999fffcb01d2b99367d91c7e4148bb7ce5b
Author: Timm Bäder <mail baedert org>
Date: Sun Sep 1 10:56:29 2019 +0200
icontheme: Remove icon_info_load_pixbuf
What it does overlaps with the only caller a lot now.
gtk/gtkicontheme.c | 33 ++++-----------------------------
1 file changed, 4 insertions(+), 29 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 9ad5e44a39..7f95c37b6b 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3640,34 +3640,6 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info)
return TRUE;
}
-static GdkPixbuf *
-icon_info_load_pixbuf (GtkIconInfo *icon_info,
- GError **error)
-{
- if (!icon_info_ensure_scale_and_pixbuf (icon_info))
- {
- if (icon_info->load_error)
- {
- if (error)
- *error = g_error_copy (icon_info->load_error);
- }
- else
- {
- g_set_error_literal (error,
- GTK_ICON_THEME_ERROR,
- GTK_ICON_THEME_NOT_FOUND,
- _("Failed to load icon"));
- }
-
- return NULL;
- }
-
- if (icon_info->pixbuf != NULL)
- return g_object_ref (icon_info->pixbuf);
-
- return NULL;
-}
-
/**
* gtk_icon_info_load_icon:
* @icon_info: a #GtkIconInfo from gtk_icon_theme_lookup_icon()
@@ -3700,7 +3672,10 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
{
GdkPixbuf *pixbuf;
- pixbuf = icon_info_load_pixbuf (icon_info, NULL);
+ icon_info_ensure_scale_and_pixbuf (icon_info);
+
+ if (icon_info->pixbuf)
+ pixbuf = g_object_ref (icon_info->pixbuf);
if (!pixbuf)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]