diff --git a/configure.in b/configure.in
index 437d34b..2420c54 100644
--- a/configure.in
+++ b/configure.in
@@ -3658,6 +3658,9 @@ fi
 
 AC_SUBST(GLIB_LINK_FLAGS)
 
+GLIB_GSETTINGS
+GLIB_COMPILE_SCHEMAS=./glib-compile-schemas
+
 AC_CONFIG_FILES([
 glib-2.0.pc
 glib-2.0-uninstalled.pc
diff --git a/gio/Makefile.am b/gio/Makefile.am
index dd6bb9e..656977f 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -566,6 +566,9 @@ gsettings_SOURCES = gsettings-tool.c
 schemadir = $(datadir)/glib-2.0/schemas
 dist_schema_DATA = gschema.dtd
 
+gsettings_SCHEMAS = org.gtk.url-handlers.gschema.xml
+@GSETTINGS_RULES@
+
 # ------------------------------------------------------------------------
 # gdbus(1) tool
 
diff --git a/gio/gappinfo.c b/gio/gappinfo.c
index 93dcbb7..2863b3b 100644
--- a/gio/gappinfo.c
+++ b/gio/gappinfo.c
@@ -817,3 +817,81 @@ g_app_launch_context_launch_failed (GAppLaunchContext *context,
   if (class->launch_failed != NULL)
     class->launch_failed (context, startup_notify_id);
 }
+
+/**
+ * g_app_info_get_default_for_uri_scheme:
+ * @uri_scheme: a string containing a URI scheme.
+ *
+ * Gets the default application for launching applications
+ * using this URI scheme. A URI scheme is the initial part
+ * of the URI, up to but not including the ':', e.g. "http",
+ * "ftp" or "sip".
+ *
+ * Starting with GLib 2.26, this information is obtained
+ * via GSettings.
+ *
+ * Returns: #GAppInfo for given @uri_scheme or %NULL on error.
+ */
+GAppInfo *
+g_app_info_get_default_for_uri_scheme (const char *uri_scheme)
+{
+  GAppInfo *appinfo;
+  GSettings *settings;
+  GSettings *child;
+  gchar *command;
+  gboolean enabled, needs_terminal;
+  GAppInfoCreateFlags flags;
+  gchar **items;
+  gchar *item;
+  gint i;
+
+  appinfo = NULL;
+  child = NULL;
+
+  /* FIXME: this should be a settings list, to be extensible */
+  settings = g_settings_new ("org.gtk.url-handlers");
+  item = g_strconcat (uri_scheme, "/", NULL);
+  items = g_settings_list_items (settings);
+  for (i = 0; items[i]; i++)
+    {
+      if (strcmp (items[i], item) == 0)
+        {
+          child = g_settings_get_child (settings, uri_scheme);
+          break;
+        }
+    }
+  g_object_unref (settings);
+  g_free (item);
+
+  if (child == NULL)
+    return NULL;
+
+  command = g_settings_get_string (child, "command");
+  if (command)
+    {
+      enabled = g_settings_get_boolean (child, "enabled");
+      needs_terminal = g_settings_get_boolean (child, "needs-terminal");
+
+      if (enabled)
+        {
+          if (g_str_has_suffix (command, "\"%s\"") ||
+              g_str_has_suffix (command, "\'%s\'"))
+            command[strlen (command) - 4] = 0;
+          else if (g_str_has_suffix (command, "%s"))
+            command[strlen (command) - 2] = 0;
+
+          flags = G_APP_INFO_CREATE_SUPPORTS_URIS;
+          if (needs_terminal)
+            flags |= G_APP_INFO_CREATE_NEEDS_TERMINAL;
+          appinfo = g_app_info_create_from_commandline (command,
+                                                        NULL,
+                                                        flags,
+                                                        NULL);
+        }
+    }
+
+  g_object_unref (child);
+  g_free (command);
+
+  return appinfo;
+}
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 6600684..192a8d4 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -1814,71 +1814,6 @@ g_app_info_get_default_for_type (const char *content_type,
   return info;
 }
 
-/**
- * g_app_info_get_default_for_uri_scheme:
- * @uri_scheme: a string containing a URI scheme.
- *
- * Gets the default application for launching applications 
- * using this URI scheme. A URI scheme is the initial part 
- * of the URI, up to but not including the ':', e.g. "http", 
- * "ftp" or "sip".
- * 
- * Returns: #GAppInfo for given @uri_scheme or %NULL on error.
- **/
-GAppInfo *
-g_app_info_get_default_for_uri_scheme (const char *uri_scheme)
-{
-  static gsize lookup = 0;
-  
-  if (g_once_init_enter (&lookup))
-    {
-      gsize setup_value = 1;
-      GDesktopAppInfoLookup *lookup_instance;
-      const char *use_this;
-      GIOExtensionPoint *ep;
-      GIOExtension *extension;
-      GList *l;
-
-      use_this = g_getenv ("GIO_USE_URI_ASSOCIATION");
-      
-      /* Ensure vfs in modules loaded */
-      _g_io_modules_ensure_loaded ();
-      
-      ep = g_io_extension_point_lookup (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
-
-      lookup_instance = NULL;
-      if (use_this)
-	{
-	  extension = g_io_extension_point_get_extension_by_name (ep, use_this);
-	  if (extension)
-	    lookup_instance = g_object_new (g_io_extension_get_type (extension), NULL);
-	}
-      
-      if (lookup_instance == NULL)
-	{
-	  for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next)
-	    {
-	      extension = l->data;
-	      lookup_instance = g_object_new (g_io_extension_get_type (extension), NULL);
-	      if (lookup_instance != NULL)
-		break;
-	    }
-	}
-
-      if (lookup_instance != NULL)
-	setup_value = (gsize)lookup_instance;
-      
-      g_once_init_leave (&lookup, setup_value);
-    }
-
-  if (lookup == 1)
-    return NULL;
-
-  return g_desktop_app_info_lookup_get_default_for_uri_scheme (G_DESKTOP_APP_INFO_LOOKUP (lookup),
-							       uri_scheme);
-}
-
-
 static void
 get_apps_from_dir (GHashTable *apps, 
                    const char *dirname, 
diff --git a/gio/gdesktopappinfo.h b/gio/gdesktopappinfo.h
index 48c9693..448e5fa 100644
--- a/gio/gdesktopappinfo.h
+++ b/gio/gdesktopappinfo.h
@@ -56,6 +56,8 @@ gboolean         g_desktop_app_info_get_is_hidden     (GDesktopAppInfo *info);
 void             g_desktop_app_info_set_desktop_env   (const char      *desktop_env);
 
 
+#if !defined(G_DISABLE_DEPRECATED) || defined(GIO_COMPILATION)
+
 #define G_TYPE_DESKTOP_APP_INFO_LOOKUP           (g_desktop_app_info_lookup_get_type ())
 #define G_DESKTOP_APP_INFO_LOOKUP(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP, GDesktopAppInfoLookup))
 #define G_IS_DESKTOP_APP_INFO_LOOKUP(obj)	 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP))
@@ -91,6 +93,8 @@ GType     g_desktop_app_info_lookup_get_type                   (void) G_GNUC_CON
 GAppInfo *g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup,
                                                                 const char            *uri_scheme);
 
+#endif
+
 G_END_DECLS
 
 #endif /* __G_DESKTOP_APP_INFO_H__ */
diff --git a/gio/gio.symbols b/gio/gio.symbols
index 1163edf..f9ee27a 100644
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@ -66,6 +66,7 @@ g_app_info_launch_uris
 g_app_info_should_show
 g_app_info_set_as_default_for_type
 g_app_info_set_as_default_for_extension
+g_app_info_get_default_for_uri_scheme
 g_app_info_add_supports_type
 g_app_info_can_remove_supports_type
 g_app_info_remove_supports_type
@@ -84,7 +85,6 @@ g_app_info_create_from_commandline
 g_app_info_get_all
 g_app_info_get_all_for_type
 g_app_info_get_default_for_type
-g_app_info_get_default_for_uri_scheme
 g_app_info_reset_type_associations
 #endif
 #endif
@@ -101,11 +101,13 @@ g_desktop_app_info_get_filename
 g_desktop_app_info_get_type G_GNUC_CONST
 g_desktop_app_info_get_is_hidden
 g_desktop_app_info_set_desktop_env
+#ifndef G_DISABLE_DEPRECATED
 g_desktop_app_info_lookup_get_type G_GNUC_CONST
 g_desktop_app_info_lookup_get_default_for_uri_scheme
 #endif
 #endif
 #endif
+#endif
 
 
 #if IN_HEADER(__G_ASYNC_RESULT_H__)
diff --git a/gio/org.gtk.url-handlers.gschema.xml b/gio/org.gtk.url-handlers.gschema.xml
new file mode 100644
index 0000000..ddd5f35
--- /dev/null
+++ b/gio/org.gtk.url-handlers.gschema.xml
@@ -0,0 +1,184 @@
+<schemalist gettext-domain="glib20">
+  <schema id="org.gtk.url-handlers" path="/org/gtk/url-handlers/">
+    <child name="trash" schema="org.gtk.url-handlers.trash"/>
+    <child name="ghelp" schema="org.gtk.url-handlers.ghelp"/>
+    <child name="info" schema="org.gtk.url-handlers.info"/>
+    <child name="man" schema="org.gtk.url-handlers.man"/>
+    <child name="http" schema="org.gtk.url-handlers.http"/>
+    <child name="https" schema="org.gtk.url-handlers.https"/>
+    <child name="mailto" schema="org.gtk.url-handlers.mailto"/>
+    <child name="aim" schema="org.gtk.url-handlers.aim"/>
+    <child name="callto" schema="org.gtk.url-handlers.callto"/>
+    <child name="h323" schema="org.gtk.url-handlers.h323"/>
+  </schema>
+  <schema id="org.gtk.url-handlers.trash" path="/org/gtk/url-handlers/trash/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "trash" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "trash" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'nautilus "%s"'</default>
+      <summary>The handler for "trash" URLs</summary>
+      <description>The command used to handle "trash" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.ghelp" path="/org/gtk/url-handlers/ghelp/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "ghelp" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "ghelp" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'gnome-help "%s"'</default>
+      <summary>The handler for "ghelp" URLs</summary>
+      <description>The command used to handle "ghelp" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.info" path="/org/gtk/url-handlers/info/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "info" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "info" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'gnome-help "%s"'</default>
+      <summary>The handler for "info" URLs</summary>
+      <description>The command used to handle "info" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.man" path="/org/gtk/url-handlers/man/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "man" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "man" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'gnome-help "%s"'</default>
+      <summary>The handler for "man" URLs</summary>
+      <description>The command used to handle "man" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.http" path="/org/gtk/url-handlers/http/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "http" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "http" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'epiphany %s'</default>
+      <summary>The handler for "http" URLs</summary>
+      <description>The command used to handle "http" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.https" path="/org/gtk/url-handlers/https/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "https" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "https" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'epiphany %s'</default>
+      <summary>The handler for "https" URLs</summary>
+      <description>The command used to handle "https" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.mailto" path="/org/gtk/url-handlers/mailto/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "mailto" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "mailto" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'evolution %s'</default>
+      <summary>The handler for "mailto" URLs</summary>
+      <description>The command used to handle "mailto" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.aim" path="/org/gtk/url-handlers/aim/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "aim" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "aim" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'gaim-remote uri "%s"'</default>
+      <summary>The handler for "aim" URLs</summary>
+      <description>The command used to handle "aim" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.callto" path="/org/gtk/url-handlers/callto/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "callto" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "callto" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'gnomemeeting -c %s'</default>
+      <summary>The handler for "callto" URLs</summary>
+      <description>The command used to handle "callto" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+  <schema id="org.gtk.url-handlers.h323" path="/org/gtk/url-handlers/h323/">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Whether the specified command should handle "h323" URLs</summary>
+      <description>True if the command specified in the "command" key should handle "h323" URLs.</description>
+    </key>
+    <key name="command" type="s">
+      <default>'gnomemeeting -c %s'</default>
+      <summary>The handler for "h323" URLs</summary>
+      <description>The command used to handle "h323" URLs, if enabled.</description>
+    </key>
+    <key name="needs-terminal" type="b">
+      <default>false</default>
+      <summary>Run the command in a terminal</summary>
+      <description>True if the command used to handle this type of URL should be run in a terminal.</description>
+    </key>
+  </schema>
+</schemalist>
