diff options
author | infirit <[email protected]> | 2014-12-13 23:28:54 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-13 23:28:54 +0100 |
commit | fbd06f59d4bc1407108f5b6f060ea4dffaf56032 (patch) | |
tree | 5bb77f3cb7c2b3d8327056473298e2a6e64c72dc /plugins/media-keys/msd-media-keys-manager.c | |
parent | 723f821493aeedac089d1905b3d5487b0968c5b7 (diff) | |
download | mate-settings-daemon-fbd06f59d4bc1407108f5b6f060ea4dffaf56032.tar.bz2 mate-settings-daemon-fbd06f59d4bc1407108f5b6f060ea4dffaf56032.tar.xz |
Sync with GSD: Use MIME types for schemes, not GConf
Take the improvement from GSD
Commit: 3e4dbcd54412a58d7e6ebde58f191d2a001518b8
From: Rodrigo Moya <[email protected]>
Diffstat (limited to 'plugins/media-keys/msd-media-keys-manager.c')
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c index e37b723..95ef52a 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -455,43 +455,29 @@ dialog_show (MsdMediaKeysManager *manager) } static void -do_uri_action (MsdMediaKeysManager *manager, gchar *uri) +do_url_action (MsdMediaKeysManager *manager, + const gchar *scheme) { GError *error = NULL; GAppInfo *app_info; - app_info = g_app_info_get_default_for_uri_scheme (uri); + app_info = g_app_info_get_default_for_uri_scheme (scheme); if (app_info != NULL) { 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_object_unref (app_info); g_error_free (error); } } else { - g_warning ("Could not find default application for '%s' scheme", uri); + g_warning ("Could not find default application for '%s' scheme", scheme); } } static void -do_help_action (MsdMediaKeysManager *manager) -{ - GError *error = NULL; - if (!g_app_info_launch_default_for_uri ("http://wiki.mate-desktop.org/docs", NULL, &error)) { - g_warning ("Could not launch help application: %s", error->message); - g_error_free (error); - } -} - -static void -do_mail_action (MsdMediaKeysManager *manager) -{ - do_uri_action (manager, "mailto"); -} - -static void do_media_action (MsdMediaKeysManager *manager) { GError *error = NULL; @@ -513,12 +499,6 @@ do_media_action (MsdMediaKeysManager *manager) } static void -do_www_action (MsdMediaKeysManager *manager) -{ - do_uri_action (manager, "http"); -} - -static void do_exit_action (MsdMediaKeysManager *manager) { execute (manager, "mate-session-save --shutdown-dialog", FALSE, FALSE); @@ -967,7 +947,7 @@ do_action (MsdMediaKeysManager *manager, g_free (cmd); break; case EMAIL_KEY: - do_mail_action (manager); + do_url_action (manager, "mailto"); break; case SCREENSAVER_KEY: if ((cmd = g_find_program_in_path ("mate-screensaver-command"))) { @@ -979,10 +959,10 @@ do_action (MsdMediaKeysManager *manager, g_free (cmd); break; case HELP_KEY: - do_help_action (manager); + do_url_action (manager, "help"); break; case WWW_KEY: - do_www_action (manager); + do_url_action (manager, "http"); break; case MEDIA_KEY: do_media_action (manager); |