Skip to content

Commit 72982f7

Browse files
vuntzraveit65
authored andcommitted
clock: Use new GdkPixbuf API to load resources
origin commit: https://git.gnome.org/browse/gnome-panel/commit/?h=gnome-3-4&id=3c0af36
1 parent dcb6025 commit 72982f7

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

‎applets/clock/clock-map.c‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,10 @@ clock_map_init (ClockMap *this)
136136

137137
for (i = 0; i < MARKER_NB; i++) {
138138
char *resource;
139-
GInputStream *stream;
140139

141140
resource = g_strconcat (CLOCK_RESOURCE_PATH "icons/", marker_files[i], NULL);
142-
stream = g_resources_open_stream (resource, 0, NULL);
141+
priv->location_marker_pixbuf[i] = gdk_pixbuf_new_from_resource (resource, NULL);
143142
g_free (resource);
144-
145-
if (stream != NULL) {
146-
priv->location_marker_pixbuf[i] = gdk_pixbuf_new_from_stream (stream, NULL, NULL);
147-
g_object_unref (stream);
148-
}
149143
}
150144
}
151145

@@ -217,17 +211,10 @@ clock_map_refresh (ClockMap *this)
217211
}
218212

219213
if (!priv->stock_map_pixbuf) {
220-
GInputStream *stream = g_resources_open_stream (CLOCK_RESOURCE_PATH "icons/clock-map.png",
221-
0, NULL);
222-
if (stream != NULL) {
223-
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream,
224-
priv->width, priv->height,
225-
FALSE,
226-
NULL, NULL);
227-
g_object_unref (stream);
228-
229-
priv->stock_map_pixbuf = pixbuf;
230-
}
214+
priv->stock_map_pixbuf = gdk_pixbuf_new_from_resource_at_scale (CLOCK_RESOURCE_PATH "icons/clock-map.png",
215+
priv->width, priv->height,
216+
FALSE,
217+
NULL);
231218
}
232219

233220
clock_map_place_locations (this);

‎configure.ac‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fi
5555
LT_LIB_M
5656

5757
LIBMATE_DESKTOP_REQUIRED=1.17.0
58-
GDK_PIXBUF_REQUIRED=2.7.1
58+
GDK_PIXBUF_REQUIRED=2.25.2
5959
PANGO_REQUIRED=1.15.4
6060
GLIB_REQUIRED=2.50.0
6161
LIBMATE_MENU_REQUIRED=1.10.0

0 commit comments

Comments
 (0)