[nautilus-actions] NaxmlReader: return a synthetic message if cannot handle the uri
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] NaxmlReader: return a synthetic message if cannot handle the uri
- Date: Mon, 5 Dec 2011 18:54:07 +0000 (UTC)
commit 27efc8abf0d0867cedcc5b74445bce8376ec572f
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Dec 5 06:06:44 2011 +0100
NaxmlReader: return a synthetic message if cannot handle the uri
ChangeLog | 8 ++++++++
src/io-xml/naxml-reader.c | 8 ++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 54ea6e4..4990c5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2011-12-05 Pierre Wieser <pwieser trychlos org>
+ * src/io-xml/naxml-reader.c (naxml_reader_import_from_uri):
+ Display an synthetic error message if cannot handle the file.
+
+ * src/io-desktop/nadp-reader.c (nadp_reader_iimporter_import_from_uri):
+ Display an synthetic error message if cannot handle the file.
+
+ * po/POTFILES.in: Updated accordingly.
+
* src/core/na-importer.c (import_from_uri): Only display error messages
of the interface which has eventually successfully imported the item.
diff --git a/src/io-xml/naxml-reader.c b/src/io-xml/naxml-reader.c
index 84a409f..a07d060 100644
--- a/src/io-xml/naxml-reader.c
+++ b/src/io-xml/naxml-reader.c
@@ -152,7 +152,7 @@ static RootNodeStr st_root_node_str[] = {
#define ERR_NODE_UNKNOWN _( "Unknown element %s found at line %d while waiting for %s." )
/* i18n: do not translate keywords 'Action' nor 'Menu' */
#define ERR_NODE_UNKNOWN_TYPE _( "Unknown type %s found at line %d, while waiting for Action or Menu." )
-#define WARN_UNDEALT_NODE _( "Node %s at line %d has not been dealt with." )
+#define ERR_NOT_IOXML _( "The XML I/O Provider is not able to handle the URI" )
static void read_start_profile_attach_profile( NAXMLReader *reader, NAObjectProfile *profile );
static gboolean read_data_is_path_adhoc_for_object( NAXMLReader *reader, const NAIFactoryObject *object, xmlChar *text );
@@ -339,6 +339,10 @@ naxml_reader_import_from_uri( const NAIImporter *instance, NAIImporterImportFrom
code = reader_parse_xmldoc( reader );
+ if( code == IMPORTER_CODE_NOT_WILLING_TO ){
+ na_core_utils_slist_add_message( &reader->private->parms->messages, ERR_NOT_IOXML );
+ }
+
if( code == IMPORTER_CODE_OK ){
g_return_val_if_fail( NA_IS_OBJECT_ITEM( parms->imported ), IMPORTER_CODE_PROGRAM_ERROR );
code = manage_import_mode( reader );
@@ -364,7 +368,7 @@ naxml_reader_import_from_uri( const NAIImporter *instance, NAIImporterImportFrom
* and that the root node can be identified as a schema or a dump
*
* At import time, it is worthless to say that there is, e.g. a badly formed
- * xml file, as we even not sure that we are trying to import a .xml.
+ * xml file, as we are not even sure that we are trying to import a .xml.
* So just keep ride of error messages here.
*/
static guint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]