[gnome-settings-daemon] media-keys: Use gtk_show_uri() to launch nautilus
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Use gtk_show_uri() to launch nautilus
- Date: Tue, 13 Sep 2011 14:48:18 +0000 (UTC)
commit 2a08f73a4d09f60e79822e0de33256cacc7b822b
Author: Bastien Nocera <hadess hadess net>
Date: Tue Sep 13 14:46:06 2011 +0100
media-keys: Use gtk_show_uri() to launch nautilus
plugins/media-keys/gsd-media-keys-manager.c | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 695f2de..391e116 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -585,6 +585,25 @@ do_eject_action (GsdMediaKeysManager *manager)
}
static void
+do_home_key_action (GsdMediaKeysManager *manager,
+ gint64 timestamp)
+{
+ GFile *file;
+ GError *error = NULL;
+ char *uri;
+
+ file = g_file_new_for_path (g_get_home_dir ());
+ uri = g_file_get_uri (file);
+ g_object_unref (file);
+
+ if (gtk_show_uri (NULL, uri, timestamp, &error) == FALSE) {
+ g_warning ("Failed to launch '%s': %s", uri, error->message);
+ g_error_free (error);
+ }
+ g_free (uri);
+}
+
+static void
do_touchpad_osd_action (GsdMediaKeysManager *manager, gboolean state)
{
dialog_init (manager);
@@ -1402,7 +1421,6 @@ do_action (GsdMediaKeysManager *manager,
gint64 timestamp)
{
char *cmd;
- char *path;
g_debug ("Launching action for key type '%d'", type);
@@ -1445,11 +1463,7 @@ do_action (GsdMediaKeysManager *manager,
do_eject_action (manager);
break;
case HOME_KEY:
- path = g_shell_quote (g_get_home_dir ());
- cmd = g_strconcat ("nautilus --no-desktop ", path, NULL);
- g_free (path);
- execute (manager, cmd, FALSE, FALSE);
- g_free (cmd);
+ do_home_key_action (manager, timestamp);
break;
case SEARCH_KEY:
cmd = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]