[gcr] gcr: Fix problem looking up the renderers
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] gcr: Fix problem looking up the renderers
- Date: Wed, 30 Nov 2011 11:09:36 +0000 (UTC)
commit 25b171348301141da37239078c81f3d0cfad1d68
Author: Stef Walter <stefw collabora co uk>
Date: Wed Nov 30 11:56:37 2011 +0100
gcr: Fix problem looking up the renderers
* Fix format being copied in gcr_parsed_ref()
* Add debug output to the lookup for importers
gcr/gcr-importer.c | 14 ++++++++++++++
gcr/gcr-parser.c | 2 ++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gcr/gcr-importer.c b/gcr/gcr-importer.c
index cb57285..0eaa816 100644
--- a/gcr/gcr-importer.c
+++ b/gcr/gcr-importer.c
@@ -23,6 +23,8 @@
#include "config.h"
+#define DEBUG_FLAG GCR_DEBUG_IMPORT
+#include "gcr-debug.h"
#include "gcr-deprecated-base.h"
#include "gcr-importer.h"
#include "gcr-internal.h"
@@ -220,6 +222,12 @@ gcr_importer_create_for_parsed (GcrParsed *parsed)
seen = g_hash_table_new (g_direct_hash, g_direct_equal);
+ if (_gcr_debugging) {
+ gchar *a = gck_attributes_to_string (attrs);
+ _gcr_debug ("looking for importer for: %s", a);
+ g_free (a);
+ }
+
for (i = 0; i < registered_importers->len; ++i) {
registered = &(g_array_index (registered_importers, GcrRegistered, i));
n_attrs = gck_attributes_count (registered->attrs);
@@ -233,6 +241,12 @@ gcr_importer_create_for_parsed (GcrParsed *parsed)
}
}
+ if (_gcr_debugging) {
+ gchar *a = gck_attributes_to_string (registered->attrs);
+ _gcr_debug ("importer %s: %s", matched ? "matched" : "didn't match", a);
+ g_free (a);
+ }
+
if (matched) {
if (check_if_seen_or_add (seen, GUINT_TO_POINTER (registered->importer_type)))
continue;
diff --git a/gcr/gcr-parser.c b/gcr/gcr-parser.c
index 006e2ad..fdb73d4 100644
--- a/gcr/gcr-parser.c
+++ b/gcr/gcr-parser.c
@@ -2639,6 +2639,7 @@ gcr_parsed_ref (GcrParsed *parsed)
copy->refs = 1;
copy->label = g_strdup (gcr_parsed_get_label (parsed));
copy->attrs = gcr_parsed_get_attributes (parsed);
+ copy->format = gcr_parsed_get_format (parsed);
if (copy->attrs)
gck_attributes_ref (copy->attrs);
copy->description = gcr_parsed_get_description (parsed);
@@ -2648,6 +2649,7 @@ gcr_parsed_ref (GcrParsed *parsed)
while (parsed != NULL) {
if (parsed->data != NULL) {
copy->data = egg_bytes_ref (parsed->data);
+ copy->sensitive = parsed->sensitive;
break;
}
parsed = parsed->next;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]