Commit Graph

6 Commits

Author SHA1 Message Date
Ryan Lortie
3a7b44c007 giomodule: add a new "get default" function
_gio_module_get_default() is a very convenient function for modules
implementing a singleton -- it finds the default module by priority
subject to override by a given environment variable name, instantiates
it, and caches the instance for future calls.  It also has the ability
to query instances for being 'active' using a callback.

It doesn't work very well for non-singletons (like file monitors).

Add a new function _gio_module_get_default_type() that skips the
instantiation, returning the GType instead.  As a replacement for the
'active' callback, a vtable offset can be given for a virtual function
to use to query if a particular backend is supported.

https://bugzilla.gnome.org/show_bug.cgi?id=592211
2013-01-19 14:04:49 -05:00
Alexander Larsson
bd148e127a Add _g_io_win32_get_module to get the gio HMODULE 2012-04-20 15:02:48 +02:00
Dan Winship
1481b7bca3 Add _g_io_module_get_default(), use to simplify other *_get_default()s
Add _g_io_module_get_default(), which implements the
figure-out-the-best-available-module-that-is-actually-usable logic,
and use that to simplify g_proxy_resolver_get_default(),
g_settings_backend_get_default(), g_tls_backend_get_default(), and
g_vfs_get_default().

https://bugzilla.gnome.org/show_bug.cgi?id=620932
2011-10-04 13:20:34 -04:00
Alexander Larsson
b3cb7caf7d Split out the extension point registration code to its own function.
2009-02-27  Alexander Larsson  <alexl@redhat.com>

        * giomodule-priv.h:
        * giomodule.c:
	Split out the extension point registration code to its
	own function.

        * glocalvfs.c:
	Ensure extension points are registered before extending it.
	It might not have happened yet if g_vfs_get_local() is called.



svn path=/trunk/; revision=7919
2009-02-27 15:22:11 +00:00
Matthias Clasen
fb5ddf6ecf 2.15.4
svn path=/trunk/; revision=6402
2008-01-29 00:00:31 +00:00
Alexander Larsson
3869c33a73 Added.
2007-12-05  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * giomodule-priv.h: Added.
        * glocaldirectorymonitor.c:
        * glocalfilemonitor.c:
        * gunionvolumemonitor.c:
        * gvfs.c:
	Actually add the declaration of _g_io_modules_ensure_loaded


svn path=/trunk/; revision=6051
2007-12-05 11:10:21 +00:00