[gnome-panel] clock: Use new GdkPixbuf API to load resources



commit 3c0af368a70b74e803420ca306dde9b3ee2acff2
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Feb 7 10:04:37 2012 +0100

    clock: Use new GdkPixbuf API to load resources

 applets/clock/clock-map.c |   23 +++++------------------
 configure.ac              |    4 ++--
 gnome-panel/nothing.cP    |    9 +--------
 3 files changed, 8 insertions(+), 28 deletions(-)
---
diff --git a/applets/clock/clock-map.c b/applets/clock/clock-map.c
index 5046e43..a644d25 100644
--- a/applets/clock/clock-map.c
+++ b/applets/clock/clock-map.c
@@ -137,16 +137,10 @@ clock_map_init (ClockMap *this)
 
         for (i = 0; i < MARKER_NB; i++) {
                 char *resource;
-                GInputStream *stream;
 
                 resource = g_strconcat (CLOCK_RESOURCE_PATH "icons/", marker_files[i], NULL);
-                stream = g_resources_open_stream (resource, 0, NULL);
+                priv->location_marker_pixbuf[i] = gdk_pixbuf_new_from_resource (resource, NULL);
                 g_free (resource);
-
-                if (stream != NULL) {
-                        priv->location_marker_pixbuf[i] = gdk_pixbuf_new_from_stream (stream, NULL, NULL);
-                        g_object_unref (stream);
-                }
         }
 }
 
@@ -218,17 +212,10 @@ clock_map_refresh (ClockMap *this)
         }
 
         if (!priv->stock_map_pixbuf) {
-                GInputStream *stream = g_resources_open_stream (CLOCK_RESOURCE_PATH "icons/clock-map.png",
-                                                                0, NULL);
-                if (stream != NULL) {
-                        GdkPixbuf *pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream,
-                                                                                 priv->width, priv->height,
-                                                                                 FALSE,
-                                                                                 NULL, NULL);
-                        g_object_unref (stream);
-
-                        priv->stock_map_pixbuf = pixbuf;
-                }
+                priv->stock_map_pixbuf = gdk_pixbuf_new_from_resource_at_scale (CLOCK_RESOURCE_PATH "icons/clock-map.png",
+                                                                                priv->width, priv->height,
+                                                                                FALSE,
+                                                                                NULL);
         }
 
         clock_map_place_locations (this);
diff --git a/configure.ac b/configure.ac
index 96a5f37..edd6c01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,10 +59,10 @@ AC_CHECK_HEADERS(crt_externs.h)
 AC_CHECK_FUNCS(_NSGetEnviron)
 
 LIBGNOME_DESKTOP_REQUIRED=2.91.0
-GDK_PIXBUF_REQUIRED=2.7.1
+GDK_PIXBUF_REQUIRED=2.25.2
 PANGO_REQUIRED=1.15.4
 GLIB_REQUIRED=2.31.14
-GTK_REQUIRED=3.0
+GTK_REQUIRED=3.3.8
 LIBWNCK_REQUIRED=2.91.0
 GCONF_REQUIRED=2.6.1
 LIBGNOME_MENU_REQUIRED=3.1.4
diff --git a/gnome-panel/nothing.cP b/gnome-panel/nothing.cP
index e016698..27c98e1 100644
--- a/gnome-panel/nothing.cP
+++ b/gnome-panel/nothing.cP
@@ -171,18 +171,11 @@ get_phsh_pixbuf (void)
 {
         char *resource;
         GdkPixbuf *pixbuf;
-        GInputStream *stream;
 
         resource = g_strdup_printf ("%s%cand%c.png", "/org/gnome/panel/anim/", 'w', 'a');
-        stream = g_resources_open_stream (resource, 0, NULL);
+        pixbuf = gdk_pixbuf_new_from_resource (resource, NULL);
         g_free (resource);
 
-        if (!stream)
-                return NULL;
-
-        pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, NULL);
-        g_object_unref (stream);
-
         return pixbuf;
 }
 



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