24 #define EV_BACKENDS_GROUP "Evince Backend"
25 #define EV_BACKENDS_EXTENSION ".evince-backend"
36 g_return_val_if_fail (info != NULL, NULL);
37 g_return_val_if_fail (info->ref_count >= 1, NULL);
39 g_atomic_int_inc (&info->ref_count);
55 g_return_if_fail (info->ref_count >= 1);
57 if (!g_atomic_int_dec_and_test (&info->ref_count))
60 g_free (info->module_name);
61 g_free (info->type_desc);
62 g_strfreev (info->mime_types);
80 GKeyFile *backend_file = NULL;
82 backend_file = g_key_file_new ();
83 if (!g_key_file_load_from_file (backend_file, file, G_KEY_FILE_NONE, error))
91 if (!info->module_name)
98 "TypeDescription", NULL, error);
103 "MimeType", NULL, error);
104 if (!info->mime_types)
107 g_key_file_free (backend_file);
112 g_key_file_free (backend_file);
132 GError *error = NULL;
134 dir = g_dir_open (path, 0, &error);
136 g_warning (
"%s", error->message);
137 g_error_free (error);
142 while ((dirent = g_dir_read_name (dir))) {
149 file = g_build_filename (path, dirent, NULL);
152 g_warning (
"Failed to load backend info from '%s': %s\n",
153 file, error->message);
154 g_clear_error (&error);
161 list = g_list_prepend (list, info);