pidgin.next.minor: ae1747d0: Remove all the special-casing in the GNO...

rlaager at pidgin.im rlaager at pidgin.im
Tue Dec 2 13:50:28 EST 2008


-----------------------------------------------------------------
Revision: ae1747d0fffb12e2729f1ed66aff8083309ec96b
Ancestor: b11b7c5aba20eaaf2336abb41a3200cfb2d4fb15
Author: rlaager at pidgin.im
Date: 2008-12-02T18:47:38
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/ae1747d0fffb12e2729f1ed66aff8083309ec96b

Modified files:
        pidgin/gtkutils.c

ChangeLog: 

Remove all the special-casing in the GNOME URL handler registration.

-------------- next part --------------
============================================================
--- pidgin/gtkutils.c	8607b3874f6be1e9c4994f88278efd28c46351d0
+++ pidgin/gtkutils.c	5f6ddd15e3b35bbe7505c629085bd90460513dbb
@@ -3625,22 +3625,9 @@ register_gnome_url_handlers(void)
 
 				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)
 
 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)


More information about the Commits mailing list