Merge lp:~larsu/notify-osd/1520667 into lp:notify-osd

Proposed by Lars Karlitski
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 504
Merged at revision: 502
Proposed branch: lp:~larsu/notify-osd/1520667
Merge into: lp:notify-osd
Diff against target: 48 lines (+11/-3)
2 files modified
src/bubble.c (+10/-2)
tests/Makefile.am (+1/-1)
To merge this branch: bzr merge lp:~larsu/notify-osd/1520667
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+278861@code.launchpad.net

Commit message

bubble_set_icon: allow absolute paths in the icon name field

Description of the change

bubble_set_icon: allow absolute paths in the icon name field

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Great!

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, make check is good again with that change

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/bubble.c'
--- src/bubble.c 2015-11-18 16:39:01 +0000
+++ src/bubble.c 2015-12-01 07:45:25 +0000
@@ -2387,7 +2387,7 @@
2387 filename = g_filename_from_uri (name, NULL, &error);2387 filename = g_filename_from_uri (name, NULL, &error);
2388 if (filename == NULL)2388 if (filename == NULL)
2389 {2389 {
2390 g_printerr ("%s is not a valid file uri: %s", name, error->message);2390 g_warning ("%s is not a valid file uri: %s", name, error->message);
2391 g_error_free (error);2391 g_error_free (error);
2392 return;2392 return;
2393 }2393 }
@@ -2396,6 +2396,14 @@
23962396
2397 g_free (filename);2397 g_free (filename);
2398 }2398 }
2399 /* According to the spec, only file:// uris are allowed in the
2400 * name field. However, many applications send raw paths.
2401 * Support those as well, but only if they're absolute.
2402 */
2403 else if (name[0] == '/')
2404 {
2405 priv->icon_pixbuf = gdk_pixbuf_new_from_file_at_scale (name, scale * icon_size, scale * icon_size, TRUE, NULL);
2406 }
2399 else2407 else
2400 {2408 {
2401 GError *error = NULL;2409 GError *error = NULL;
@@ -2418,7 +2426,7 @@
24182426
2419 if (buffer == NULL)2427 if (buffer == NULL)
2420 {2428 {
2421 g_print ("Unable to load icon '%s': %s", name, error->message);2429 g_warning ("Unable to load icon '%s': %s", name, error->message);
2422 g_error_free (error);2430 g_error_free (error);
2423 return;2431 return;
2424 }2432 }
24252433
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am 2011-11-01 12:45:48 +0000
+++ tests/Makefile.am 2015-12-01 07:45:25 +0000
@@ -61,7 +61,7 @@
61 $(WNCK_CFLAGS) \61 $(WNCK_CFLAGS) \
62 $(DBUS_CFLAGS) \62 $(DBUS_CFLAGS) \
63 $(LIBNOTIFY_CFLAGS) \63 $(LIBNOTIFY_CFLAGS) \
64 -DSRCDIR=\""$(top_srcdir)"\" \64 -DSRCDIR=\""$(abs_top_srcdir)"\" \
65 -I$(top_srcdir)/src \65 -I$(top_srcdir)/src \
66 -I$(top_srcdir)/66 -I$(top_srcdir)/
6767

Subscribers

People subscribed via source and target branches