# HG changeset patch # User Richard Laager # Date 1228243658 0 # Node ID ba083e5f633b790f4b9188b5cbcd681fa3d86852 # Parent f1d81412680185820d61a498ce6f8afc658307a5 Remove all the special-casing in the GNOME URL handler registration. diff -r f1d814126801 -r ba083e5f633b pidgin/gtkutils.c --- 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)