[nautilus-actions] NAXMLReader: only search for identifier in <applyto> schema key
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] NAXMLReader: only search for identifier in <applyto> schema key
- Date: Fri, 2 Dec 2011 10:50:27 +0000 (UTC)
commit b43dc8a6733260d21bed0c343196dc41c754bd71
Author: Pierre Wieser <pwieser trychlos org>
Date: Tue Nov 29 21:15:34 2011 +0100
NAXMLReader: only search for identifier in <applyto> schema key
ChangeLog | 5 +++++
src/io-xml/naxml-reader.c | 17 ++++++++---------
2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0b27451..a1e0b35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-29 Pierre Wieser <pwieser trychlos org>
+
+ * src/io-xml/naxml-reader.c (schema_parse_schema_content):
+ Only search for identifier in <applyto> schema key.
+
2011-11-28 Pierre Wieser <pwieser trychlos org>
* src/io-desktop/nadp-desktop-file.c (check_key_file):
diff --git a/src/io-xml/naxml-reader.c b/src/io-xml/naxml-reader.c
index 0bd6bb5..84a409f 100644
--- a/src/io-xml/naxml-reader.c
+++ b/src/io-xml/naxml-reader.c
@@ -557,12 +557,12 @@ iter_on_list_children( NAXMLReader *reader, xmlNode *list )
}
}
- /* check that we have a not empty id
+ /* if we do not have any error, check that we have at least a not empty id
*/
if( code == IMPORTER_CODE_OK ){
if( !reader->private->item_id || !strlen( reader->private->item_id )){
na_core_utils_slist_add_message( &reader->private->parms->messages, ERR_ITEM_ID_NOT_FOUND );
- code = IMPORTER_CODE_NO_ITEM_ID;
+ code = IMPORTER_CODE_NO_ITEM_ID;
}
}
@@ -980,12 +980,13 @@ schema_parse_schema_content( NAXMLReader *reader, xmlNode *schema )
str->reader_found = TRUE;
/* set the item id the first time, check after
+ * - until v 2.0 of the exported schemas, both <key> and <applyto>
+ * has the id of the item (because there was one fake schema for
+ * each item)
+ * - starting with v 3, only <applyto> key has this id
*/
- if( !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_KEY ) ||
- !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_APPLYTO )){
-
+ if( !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_APPLYTO )){
schema_check_for_id( reader, iter );
-
if( !reader->private->node_ok ){
continue;
}
@@ -994,9 +995,7 @@ schema_parse_schema_content( NAXMLReader *reader, xmlNode *schema )
/* search for the type of the item
*/
if( !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_APPLYTO )){
-
schema_check_for_type( reader, iter );
-
if( !reader->private->node_ok ){
continue;
}
@@ -1007,7 +1006,7 @@ schema_parse_schema_content( NAXMLReader *reader, xmlNode *schema )
}
/*
- * check the id on 'key' and 'applyto' keys
+ * check the id on 'applyto' key
*/
static void
schema_check_for_id( NAXMLReader *reader, xmlNode *iter )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]