Mercurial > pidgin
changeset 25868:ba083e5f633b
Remove all the special-casing in the GNOME URL handler registration.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 02 Dec 2008 18:47:38 +0000 |
parents | f1d814126801 |
children | 7524f9a084ff |
files | pidgin/gtkutils.c |
diffstat | 1 files changed, 9 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkutils.c Tue Dec 02 18:47:33 2008 +0000 +++ b/pidgin/gtkutils.c Tue Dec 02 18:47:38 2008 +0000 @@ -3625,22 +3625,9 @@ start += sizeof("/desktop/gnome/url-handlers/") - 1; - /* It would be nice if this was tracked in gconf. */ - if (!strcmp(start, "ftp") || - !strcmp(start, "gopher") || - !strcmp(start, "http") || - !strcmp(start, "https")) - protocol = g_strdup_printf("%s://", start); - else - protocol = g_strdup_printf("%s:", start); - - /* We need to free this later. */ + protocol = g_strdup_printf("%s:", start); gnome_url_handlers = g_list_prepend(gnome_url_handlers, protocol); - - if (!strcmp(protocol, "mailto:")) - gtk_imhtml_class_register_protocol(protocol, url_clicked_cb, copy_email_address); - else - gtk_imhtml_class_register_protocol(protocol, url_clicked_cb, link_context_menu); + gtk_imhtml_class_register_protocol(protocol, url_clicked_cb, link_context_menu); } start = c + 1; } @@ -3652,17 +3639,18 @@ void pidgin_utils_init(void) { - gtk_imhtml_class_register_protocol("open://", open_dialog, dummy); - - /* If we're under GNOME, try registering the system URL handlers. */ - if (purple_running_gnome() && register_gnome_url_handlers()) - return; - gtk_imhtml_class_register_protocol("http://", url_clicked_cb, link_context_menu); gtk_imhtml_class_register_protocol("https://", url_clicked_cb, link_context_menu); gtk_imhtml_class_register_protocol("ftp://", url_clicked_cb, link_context_menu); gtk_imhtml_class_register_protocol("gopher://", url_clicked_cb, link_context_menu); gtk_imhtml_class_register_protocol("mailto:", url_clicked_cb, copy_email_address); + + /* Example custom URL handler. */ + gtk_imhtml_class_register_protocol("open://", open_dialog, dummy); + + /* If we're under GNOME, try registering the system URL handlers. */ + if (purple_running_gnome()) + register_gnome_url_handlers(); } void pidgin_utils_uninit(void)