diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-03-03 15:01:19 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2008-03-03 15:01:19 (GMT) |
commit | 6ee6a56490821f09bffbe17f3dde19da3a119dd8 (patch) | |
tree | 7a90695094f5909555b9a1c7439735daf4782a9f /libdocument/ev-backends-manager.c | |
parent | 0c06dc4d1656051c9613973e8bef9c7dbfaa151d (diff) |
Allow making backend modules resident. This is needed only for some
2008-03-03 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/pdf/pdfdocument.evince-backend.in:
* libdocument/ev-backends-manager.c:
(ev_backends_manager_load_backend),
(ev_backends_manager_get_document):
* libdocument/ev-module.[ch]: (ev_module_load), (ev_module_new):
Allow making backend modules resident. This is needed only for
some backends like pdf to avoid registering glib types more than
once.
svn path=/trunk/; revision=2943
Diffstat (limited to 'libdocument/ev-backends-manager.c')
-rw-r--r-- | libdocument/ev-backends-manager.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libdocument/ev-backends-manager.c b/libdocument/ev-backends-manager.c index 87f7fea..28672df 100644 --- a/libdocument/ev-backends-manager.c +++ b/libdocument/ev-backends-manager.c @@ -30,6 +30,7 @@ typedef struct _EvBackendInfo EvBackendInfo; struct _EvBackendInfo { gchar *module_name; GTypeModule *module; + gboolean resident; GType type_id; @@ -78,6 +79,9 @@ ev_backends_manager_load_backend (const gchar *file) return NULL; } + info->resident = g_key_file_get_boolean (backend_file, EV_BACKENDS_GROUP, + "Resident", NULL); + info->type_desc = g_key_file_get_locale_string (backend_file, EV_BACKENDS_GROUP, "TypeDescription", NULL, NULL); if (!info->type_desc) { @@ -194,7 +198,7 @@ ev_backends_manager_get_document (const gchar *mime_type) gchar *path; path = g_module_build_path (EV_BACKENDSDIR, info->module_name); - info->module = G_TYPE_MODULE (ev_module_new (path)); + info->module = G_TYPE_MODULE (ev_module_new (path, info->resident)); g_free (path); } |