summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <[email protected]>2012-02-07 10:04:37 +0100
committerraveit65 <[email protected]>2018-04-26 13:04:59 +0200
commit72982f7175c1badf2b177cc9eeaa3e696551f354 (patch)
tree103ced23fceff4a650b1d2e06009fbef33c44e1d
parentdcb6025f4f4a0aadda5fea831d0cb520d2201b15 (diff)
downloadmate-panel-72982f7175c1badf2b177cc9eeaa3e696551f354.tar.bz2
mate-panel-72982f7175c1badf2b177cc9eeaa3e696551f354.tar.xz
clock: Use new GdkPixbuf API to load resources
origin commit: https://git.gnome.org/browse/gnome-panel/commit/?h=gnome-3-4&id=3c0af36
-rw-r--r--applets/clock/clock-map.c23
-rw-r--r--configure.ac2
2 files changed, 6 insertions, 19 deletions
diff --git a/applets/clock/clock-map.c b/applets/clock/clock-map.c
index fa60bb7f..5b823ea4 100644
--- a/applets/clock/clock-map.c
+++ b/applets/clock/clock-map.c
@@ -136,16 +136,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);
- }
}
}
@@ -217,17 +211,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 21cabbb1..aa94cfb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,7 @@ fi
LT_LIB_M
LIBMATE_DESKTOP_REQUIRED=1.17.0
-GDK_PIXBUF_REQUIRED=2.7.1
+GDK_PIXBUF_REQUIRED=2.25.2
PANGO_REQUIRED=1.15.4
GLIB_REQUIRED=2.50.0
LIBMATE_MENU_REQUIRED=1.10.0