[rhythmbox] mpris: report the DesktopEntry property correctly
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] mpris: report the DesktopEntry property correctly
- Date: Sat, 11 Dec 2010 11:10:10 +0000 (UTC)
commit 2fb8523c1d8418983f955f1351aa62825e0b1774
Author: Jonathan Matthew <jonathan d14n org>
Date: Sat Dec 11 21:09:26 2010 +1000
mpris: report the DesktopEntry property correctly
This is actually supposed to be just the base name of the .desktop file,
not its full path.
plugins/mpris/rb-mpris-plugin.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mpris/rb-mpris-plugin.c b/plugins/mpris/rb-mpris-plugin.c
index aca8f27..1d1c821 100644
--- a/plugins/mpris/rb-mpris-plugin.c
+++ b/plugins/mpris/rb-mpris-plugin.c
@@ -235,7 +235,17 @@ get_root_property (GDBusConnection *connection,
desktop_file = egg_get_desktop_file ();
path = g_filename_from_uri (egg_desktop_file_get_source (desktop_file), NULL, error);
if (path != NULL) {
- v = g_variant_new_string (path);
+ char *basename;
+ char *ext;
+
+ basename = g_filename_display_basename (path);
+ ext = g_utf8_strrchr (basename, -1, '.');
+ if (ext != NULL) {
+ *ext = '\0';
+ }
+
+ v = g_variant_new_string (basename);
+ g_free (basename);
g_free (path);
} else {
g_warning ("Unable to return desktop file path to MPRIS client: %s", (*error)->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]