[gnome-settings-daemon] For media key, use the default application for audio/ogg
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] For media key, use the default application for audio/ogg
- Date: Wed, 13 Oct 2010 12:53:55 +0000 (UTC)
commit 08c92bf64a9704bd3bdabf9bbea2f5dfe6648019
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Wed Oct 13 14:52:56 2010 +0200
For media key, use the default application for audio/ogg
plugins/media-keys/gsd-media-keys-manager.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 0cfe826..bb7ac7a 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -460,20 +460,19 @@ do_url_action (GsdMediaKeysManager *manager,
static void
do_media_action (GsdMediaKeysManager *manager)
{
- char *command;
- GSettings *settings;
+ GAppInfo *app_info;
- settings = g_settings_new ("org.gnome.desktop.default-applications.media");
- command = g_settings_get_string (settings, "exec");
- if ((command != NULL) && (strcmp (command, "") != 0)) {
- execute (manager,
- command,
- FALSE,
- g_settings_get_boolean (settings, "needs-terminal"));
- }
+ app_info = g_app_info_get_default_for_type ("audio/ogg", FALSE);
+ if (app_info != NULL) {
+ GError *error = NULL;
- g_free (command);
- g_object_unref (settings);
+ if (!g_app_info_launch (app_info, NULL, NULL, &error)) {
+ g_warning ("Could not launch '%s': %s",
+ g_app_info_get_commandline (app_info),
+ error->message);
+ g_error_free (error);
+ }
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]