Remove build warning
[platform/upstream/libsoup.git] / libsoup / soup-proxy-resolver-gnome.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * soup-proxy-resolver-gnome.c: GNOME proxy resolution
4  *
5  * Copyright (C) 2008 Red Hat, Inc.
6  */
7
8 #ifdef HAVE_CONFIG_H
9 #include <config.h>
10 #endif
11
12 #undef SOUP_VERSION_MIN_REQUIRED
13 #define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_40
14
15 #include <string.h>
16
17 #include "soup-proxy-resolver-gnome.h"
18 #include "soup.h"
19
20 G_DEFINE_TYPE (SoupProxyResolverGNOME, soup_proxy_resolver_gnome, SOUP_TYPE_PROXY_RESOLVER_DEFAULT)
21
22 static void
23 soup_proxy_resolver_gnome_init (SoupProxyResolverGNOME *resolver_gnome)
24 {
25         GProxyResolver *gproxyresolver;
26         GIOExtensionPoint *ep;
27         GIOExtension *ext;
28         GType type;
29
30         /* FIXME: there is no way to force _g_io_modules_ensure_loaded()
31          * to be run other than by requesting some extension that we
32          * don't necessarily want.
33          */
34         gproxyresolver = g_proxy_resolver_get_default ();
35         if (strcmp (G_OBJECT_TYPE_NAME (gproxyresolver),
36                     "GProxyResolverGnome") == 0)
37                 return;
38
39         ep = g_io_extension_point_lookup (G_PROXY_RESOLVER_EXTENSION_POINT_NAME);
40         if (!ep)
41                 return;
42
43         ext = g_io_extension_point_get_extension_by_name (ep, "gnome");
44         if (!ext)
45                 return;
46
47         type = g_io_extension_get_type (ext);
48         gproxyresolver = g_object_new (type, NULL);
49         g_object_set (G_OBJECT (resolver_gnome),
50                       "gproxy-resolver", gproxyresolver,
51                       NULL);
52         g_object_unref (gproxyresolver);
53 }
54
55 static void
56 soup_proxy_resolver_gnome_class_init (SoupProxyResolverGNOMEClass *gnome_class)
57 {
58 }