diff options
author | Stef Walter <stef@memberwebs.com> | 2010-06-20 01:11:48 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2010-07-13 03:04:15 +0000 |
commit | dd767066b8db5d0b601001ad24c1bd0a34182947 (patch) | |
tree | 92d8ecb6cc406f7256e90179073fc05116b97202 /tool | |
parent | 223ac313af780ef6823e3c5b68036223cbc95de2 (diff) | |
download | gnome-keyring-dd767066b8db5d0b601001ad24c1bd0a34182947.tar.gz |
Rework how the importer and parser work together.
* Parser becomes a general source for objects.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/gkr-tool-import.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tool/gkr-tool-import.c b/tool/gkr-tool-import.c index 74bbfabb..99c38903 100644 --- a/tool/gkr-tool-import.c +++ b/tool/gkr-tool-import.c @@ -98,6 +98,7 @@ int gkr_tool_import (int argc, char *argv[]) { GcrImporter *importer; + GcrParser *parser; GError *error = NULL; GInputStream *input; gboolean res; @@ -129,8 +130,15 @@ gkr_tool_import (int argc, char *argv[]) gkr_tool_handle_error (&error, "couldn't read file: %s", *imp); ret = 1; } else { - res = gcr_importer_import (importer, input, NULL, &error); + parser = gcr_parser_new (); + gcr_importer_listen (importer, parser); + res = gcr_parser_parse_stream (parser, input, NULL, &error); g_object_unref (input); + g_object_unref (parser); + + if (res == TRUE) + res = gcr_importer_import (importer, NULL, &error); + if (res == FALSE) { if (!error || error->code != GCR_ERROR_CANCELLED) gkr_tool_handle_error (&error, "couldn't import file: %s", *imp); |