[nautilus-actions] NadpReader: return a synthetic message if cannot handle the uri



commit 0f07404c129035bafa2152e4794e2fe58e66bf59
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Dec 5 06:05:44 2011 +0100

    NadpReader: return a synthetic message if cannot handle the uri

 po/POTFILES.in               |    1 +
 src/io-desktop/nadp-reader.c |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b2321dc..c9c099b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -18,6 +18,7 @@ src/core/na-selected-info.c
 src/core/na-tokens.c
 src/io-desktop/nadp-desktop-provider.c
 src/io-desktop/nadp-formats.c
+src/io-desktop/nadp-reader.c
 src/io-gconf/nagp-gconf-provider.c
 src/io-xml/naxml-reader.c
 src/io-xml/naxml-formats.c
diff --git a/src/io-desktop/nadp-reader.c b/src/io-desktop/nadp-reader.c
index f2037df..b2d99fb 100644
--- a/src/io-desktop/nadp-reader.c
+++ b/src/io-desktop/nadp-reader.c
@@ -32,6 +32,7 @@
 #include <config.h>
 #endif
 
+#include <glib/gi18n.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -61,6 +62,8 @@ typedef struct {
 }
 	NadpReaderData;
 
+#define ERR_NOT_DESKTOP		_( "The Desktop I/O Provider is not able to handle the URI" )
+
 static GList            *get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **mesages );
 static void              get_list_of_desktop_files( const NadpDesktopProvider *provider, GList **files, const gchar *dir, GSList **messages );
 static gboolean          is_already_loaded( const NadpDesktopProvider *provider, GList *files, const gchar *desktop_id );
@@ -410,6 +413,10 @@ nadp_reader_iimporter_import_from_uri( const NAIImporter *instance, NAIImporterI
 		}
 	}
 
+	if( code == IMPORTER_CODE_NOT_WILLING_TO ){
+		na_core_utils_slist_add_message( &parms->messages, ERR_NOT_DESKTOP );
+	}
+
 	return( code );
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]