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
1=== modified file 'src/bubble.c'
2--- src/bubble.c 2015-11-18 16:39:01 +0000
3+++ src/bubble.c 2015-12-01 07:45:25 +0000
4@@ -2387,7 +2387,7 @@
5 filename = g_filename_from_uri (name, NULL, &error);
6 if (filename == NULL)
7 {
8- g_printerr ("%s is not a valid file uri: %s", name, error->message);
9+ g_warning ("%s is not a valid file uri: %s", name, error->message);
10 g_error_free (error);
11 return;
12 }
13@@ -2396,6 +2396,14 @@
14
15 g_free (filename);
16 }
17+ /* According to the spec, only file:// uris are allowed in the
18+ * name field. However, many applications send raw paths.
19+ * Support those as well, but only if they're absolute.
20+ */
21+ else if (name[0] == '/')
22+ {
23+ priv->icon_pixbuf = gdk_pixbuf_new_from_file_at_scale (name, scale * icon_size, scale * icon_size, TRUE, NULL);
24+ }
25 else
26 {
27 GError *error = NULL;
28@@ -2418,7 +2426,7 @@
29
30 if (buffer == NULL)
31 {
32- g_print ("Unable to load icon '%s': %s", name, error->message);
33+ g_warning ("Unable to load icon '%s': %s", name, error->message);
34 g_error_free (error);
35 return;
36 }
37
38=== modified file 'tests/Makefile.am'
39--- tests/Makefile.am 2011-11-01 12:45:48 +0000
40+++ tests/Makefile.am 2015-12-01 07:45:25 +0000
41@@ -61,7 +61,7 @@
42 $(WNCK_CFLAGS) \
43 $(DBUS_CFLAGS) \
44 $(LIBNOTIFY_CFLAGS) \
45- -DSRCDIR=\""$(top_srcdir)"\" \
46+ -DSRCDIR=\""$(abs_top_srcdir)"\" \
47 -I$(top_srcdir)/src \
48 -I$(top_srcdir)/
49

Subscribers

People subscribed via source and target branches