[libwnck/wip/muktupavels/icons: 2/8] icon-cache: read icons in getters
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/icons: 2/8] icon-cache: read icons in getters
- Date: Tue, 15 Mar 2022 11:39:25 +0000 (UTC)
commit c8e9941957528276295e0c47dae17b27e3245d07
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Mar 14 19:47:08 2022 +0200
icon-cache: read icons in getters
libwnck/wnck-icon-cache.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
---
diff --git a/libwnck/wnck-icon-cache.c b/libwnck/wnck-icon-cache.c
index d89e8965..9b4f1f90 100644
--- a/libwnck/wnck-icon-cache.c
+++ b/libwnck/wnck-icon-cache.c
@@ -802,12 +802,40 @@ _wnck_read_icons (WnckIconCache *icon_cache,
GdkPixbuf *
_wnck_icon_cache_get_icon (WnckIconCache *self)
{
+ GdkPixbuf *icon;
+ GdkPixbuf *mini_icon;
+
+ if (self->icon != NULL)
+ return self->icon;
+
+ icon = NULL;
+ mini_icon = NULL;
+
+ _wnck_read_icons (self, &icon, &mini_icon);
+
+ g_clear_object (&icon);
+ g_clear_object (&mini_icon);
+
return self->icon;
}
GdkPixbuf *
_wnck_icon_cache_get_mini_icon (WnckIconCache *self)
{
+ GdkPixbuf *icon;
+ GdkPixbuf *mini_icon;
+
+ if (self->mini_icon != NULL)
+ return self->mini_icon;
+
+ icon = NULL;
+ mini_icon = NULL;
+
+ _wnck_read_icons (self, &icon, &mini_icon);
+
+ g_clear_object (&icon);
+ g_clear_object (&mini_icon);
+
return self->mini_icon;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]