SoupProxyResolver: remove evil hack
authorDan Winship <danw@gnome.org>
Mon, 5 Nov 2012 17:55:48 +0000 (12:55 -0500)
committerDan Winship <danw@gnome.org>
Mon, 5 Nov 2012 17:59:35 +0000 (12:59 -0500)
Back when I deprecated SoupProxyResolver in favor of
SoupProxyURIResolver, I added an evil hack so that if anyone created a
SoupProxyResolver implementation, we'd automatically add a
SoupProxyURIResolver implementation on top of it (so that SoupSession
only needed to worry about SoupProxyURIResolver).

Anyway, (a) it's evil, (b) I'm pretty sure no one else ever
implemented a SoupProxyResolver anyway, and (c) if they did, they
really ought to have migrated to SoupProxyURIResolver by now.

So, remove the evil hack so that desrt can drop support for adding
interfaces after class_init.

https://bugzilla.gnome.org/show_bug.cgi?id=687659

libsoup/soup-proxy-resolver.c

index 8092175..7512278 100644 (file)
@@ -20,39 +20,8 @@ G_DEFINE_INTERFACE_WITH_CODE (SoupProxyResolver, soup_proxy_resolver, G_TYPE_OBJ
                              )
 
 static void
-proxy_resolver_interface_check (gpointer func_data, gpointer g_iface)
-{
-       GTypeInterface *iface = g_iface;
-
-       if (iface->g_type != SOUP_TYPE_PROXY_RESOLVER)
-               return;
-
-       /* If the class hasn't already declared that it implements
-        * SoupProxyURIResolver, add our own compat implementation.
-        */
-       if (!g_type_is_a (iface->g_instance_type, SOUP_TYPE_PROXY_URI_RESOLVER)) {
-               const GInterfaceInfo uri_resolver_interface_info = {
-                       (GInterfaceInitFunc) soup_proxy_resolver_uri_resolver_interface_init, NULL, NULL
-               };
-               g_type_add_interface_static (iface->g_instance_type,
-                                            SOUP_TYPE_PROXY_URI_RESOLVER,
-                                            &uri_resolver_interface_info);
-       }
-}
-
-
-static void
 soup_proxy_resolver_default_init (SoupProxyResolverInterface *iface)
 {
-       /* Add an interface_check where we can kludgily add the
-        * SoupProxyURIResolver interface to all SoupProxyResolvers.
-        * (SoupProxyResolver can't just implement
-        * SoupProxyURIResolver itself because interface types can't
-        * implement other interfaces.) This is an ugly hack, but it
-        * only gets used if someone actually creates a
-        * SoupProxyResolver...
-        */
-       g_type_add_interface_check (NULL, proxy_resolver_interface_check);
 }
 
 void