From e341f4f758fc704ecbc26cd30b96782afa5d54e6 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Wed, 3 Apr 2013 22:16:01 -0400 Subject: Append ".desktop" to the desktop entries reported from MPRIS This is the format that GDesktopAppInfo expects. This means that the apps will be reffered to as app.desktop in gsettings, which is consistent with how others are doing it (indicator-messages, unity, gnome shell). Backwards compatibility with old settings keys is maintained. --- src/media-player-list.vala | 2 +- src/mpris2-watcher.vala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/media-player-list.vala b/src/media-player-list.vala index 3fa08f3..73f21ce 100644 --- a/src/media-player-list.vala +++ b/src/media-player-list.vala @@ -46,7 +46,7 @@ public class MediaPlayerList { if (player == null) { message (" Really."); - var appinfo = new DesktopAppInfo (desktop_id + ".desktop"); + var appinfo = new DesktopAppInfo (desktop_id.has_suffix (".desktop") ? desktop_id : desktop_id + ".desktop"); if (appinfo == null) { warning ("unable to find application '%s'", desktop_id); return null; diff --git a/src/mpris2-watcher.vala b/src/mpris2-watcher.vala index 06ccb6e..105c797 100644 --- a/src/mpris2-watcher.vala +++ b/src/mpris2-watcher.vala @@ -66,7 +66,7 @@ public class Mpris2Watcher : GLib.Object MprisRoot? mpris2_root = this.create_mpris_root(address); if (mpris2_root == null) return; bool use_playlists = this.supports_playlists ( address ); - client_appeared (mpris2_root.DesktopEntry, address, use_playlists); + client_appeared (mpris2_root.DesktopEntry + ".desktop", address, use_playlists); } } } @@ -87,7 +87,7 @@ public class Mpris2Watcher : GLib.Object else if (previous_owner == "" && current_owner != "") { debug ("Client '%s' has appeared", name); bool use_playlists = this.supports_playlists ( name ); - client_appeared (mpris2_root.DesktopEntry, name, use_playlists); + client_appeared (mpris2_root.DesktopEntry + ".desktop", name, use_playlists); } } -- cgit v1.2.3