Merge lp:~charlesk/indicator-sound/lp-1229612 into lp:indicator-sound/14.04

Proposed by Charles Kerr
Status: Merged
Approved by: Lars Karlitski
Approved revision: 398
Merged at revision: 398
Proposed branch: lp:~charlesk/indicator-sound/lp-1229612
Merge into: lp:indicator-sound/14.04
Diff against target: 21 lines (+7/-1)
1 file modified
src/sound-menu.vala (+7/-1)
To merge this branch: bzr merge lp:~charlesk/indicator-sound/lp-1229612
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Lars Karlitski (community) Approve
Review via email: mp+192724@code.launchpad.net

Description of the change

Test that MediaPlayer's icon property isn't NULL before we serialize it.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Ah, thanks.

I think we should show "application-default-icon" when the application doesn't provide an icon through its desktop file. It's the icon that unity seems to be using in the dash as well.

review: Needs Fixing
397. By Charles Kerr

use 'application-default-icon' as the fallback media player icon

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
398. By Charles Kerr

add the null safeguard back for the pathological case of 'application-default-icon' also failing

Revision history for this message
Lars Karlitski (larsu) wrote :

Thanks.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sound-menu.vala'
2--- src/sound-menu.vala 2013-10-24 19:33:47 +0000
3+++ src/sound-menu.vala 2013-10-28 19:08:50 +0000
4@@ -141,10 +141,16 @@
5
6 void insert_player_section (MediaPlayer player) {
7 var section = new Menu ();
8+ Icon icon;
9+
10+ icon = player.icon;
11+ if (icon == null)
12+ icon = new ThemedIcon.with_default_fallbacks ("application-default-icon");
13
14 var player_item = new MenuItem (player.name, "indicator." + player.id);
15 player_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.media-player");
16- player_item.set_attribute_value ("icon", g_icon_serialize (player.icon));
17+ if (icon != null)
18+ player_item.set_attribute_value ("icon", g_icon_serialize (icon));
19 section.append_item (player_item);
20
21 var playback_item = new MenuItem (null, null);

Subscribers

People subscribed via source and target branches