mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
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
This commit is contained in:
parent
b96539a4c0
commit
b3cb7caf7d
@ -1,3 +1,14 @@
|
||||
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.
|
||||
|
||||
2009-02-26 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as document
|
||||
|
@ -27,7 +27,8 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void _g_io_modules_ensure_loaded (void);
|
||||
void _g_io_modules_ensure_extension_points_registered (void);
|
||||
void _g_io_modules_ensure_loaded (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -297,19 +297,17 @@ extern GType g_win32_directory_monitor_get_type (void);
|
||||
extern GType _g_winhttp_vfs_get_type (void);
|
||||
|
||||
void
|
||||
_g_io_modules_ensure_loaded (void)
|
||||
_g_io_modules_ensure_extension_points_registered (void)
|
||||
{
|
||||
GList *modules, *l;
|
||||
static gboolean loaded_dirs = FALSE;
|
||||
static gboolean registered_extensions = FALSE;
|
||||
GIOExtensionPoint *ep;
|
||||
const char *module_path;
|
||||
|
||||
G_LOCK (loaded_dirs);
|
||||
|
||||
if (!loaded_dirs)
|
||||
|
||||
if (!registered_extensions)
|
||||
{
|
||||
loaded_dirs = TRUE;
|
||||
|
||||
registered_extensions = TRUE;
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
|
||||
g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP);
|
||||
@ -320,7 +318,7 @@ _g_io_modules_ensure_loaded (void)
|
||||
|
||||
ep = g_io_extension_point_register (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME);
|
||||
g_io_extension_point_set_required_type (ep, G_TYPE_LOCAL_FILE_MONITOR);
|
||||
|
||||
|
||||
ep = g_io_extension_point_register (G_VOLUME_MONITOR_EXTENSION_POINT_NAME);
|
||||
g_io_extension_point_set_required_type (ep, G_TYPE_VOLUME_MONITOR);
|
||||
|
||||
@ -329,7 +327,26 @@ _g_io_modules_ensure_loaded (void)
|
||||
|
||||
ep = g_io_extension_point_register (G_VFS_EXTENSION_POINT_NAME);
|
||||
g_io_extension_point_set_required_type (ep, G_TYPE_VFS);
|
||||
|
||||
}
|
||||
|
||||
G_UNLOCK (loaded_dirs);
|
||||
}
|
||||
|
||||
void
|
||||
_g_io_modules_ensure_loaded (void)
|
||||
{
|
||||
GList *modules, *l;
|
||||
static gboolean loaded_dirs = FALSE;
|
||||
const char *module_path;
|
||||
|
||||
_g_io_modules_ensure_extension_points_registered ();
|
||||
|
||||
G_LOCK (loaded_dirs);
|
||||
|
||||
if (!loaded_dirs)
|
||||
{
|
||||
loaded_dirs = TRUE;
|
||||
|
||||
modules = g_io_modules_load_all_in_directory (GIO_MODULE_DIR);
|
||||
|
||||
module_path = g_getenv ("GIO_EXTRA_MODULES");
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "glocalvfs.h"
|
||||
#include "glocalfile.h"
|
||||
#include "giomodule.h"
|
||||
#include "giomodule-priv.h"
|
||||
#include "gvfs.h"
|
||||
#include <gio/gdummyfile.h>
|
||||
#include <sys/types.h>
|
||||
@ -46,6 +47,7 @@ struct _GLocalVfsClass
|
||||
|
||||
#define g_local_vfs_get_type _g_local_vfs_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GLocalVfs, g_local_vfs, G_TYPE_VFS,
|
||||
_g_io_modules_ensure_extension_points_registered ();
|
||||
g_io_extension_point_implement (G_VFS_EXTENSION_POINT_NAME,
|
||||
g_define_type_id,
|
||||
"local",
|
||||
|
Loading…
Reference in New Issue
Block a user