[nautilus-actions] Load all items, emitting a warning when not valid



commit e3eb88add4ddd1a4177de1d681a7d68895a93af7
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Oct 9 14:40:52 2009 +0200

    Load all items, emitting a warning when not valid

 ChangeLog                       |    3 +++
 src/runtime/na-gconf-provider.c |   12 +++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index feb3d31..b5997d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,9 @@
 
 	* src/nact/Makefile.am: Updated accordingly.
 
+	* src/runtime/na-gconf-provider.c (read_item_action_profile_properties):
+	Load all found items, emitting a warning when non valid.
+
 	* src/runtime/na-object-action.c (object_is_valid):
 	An action is valid if it has at least one valid profile.
 
diff --git a/src/runtime/na-gconf-provider.c b/src/runtime/na-gconf-provider.c
index 37b4823..f6a0000 100644
--- a/src/runtime/na-gconf-provider.c
+++ b/src/runtime/na-gconf-provider.c
@@ -618,12 +618,10 @@ read_item_action_profile_properties( NAGConfProvider *provider, GSList *entries,
 	GSList *basenames, *schemes, *mimetypes;
 	gboolean isfile, isdir, multiple, matchcase;
 
-	if( !na_gconf_utils_get_string_from_entries( entries, ACTION_PROFILE_LABEL_ENTRY, &label )){
-		g_warning( "%s: no label found", thisfn );
-		label = g_strdup( "" );
+	if( na_gconf_utils_get_string_from_entries( entries, ACTION_PROFILE_LABEL_ENTRY, &label )){
+		na_object_set_label( profile, label );
+		g_free( label );
 	}
-	na_object_set_label( profile, label );
-	g_free( label );
 
 	if( na_gconf_utils_get_string_from_entries( entries, ACTION_PATH_ENTRY, &path )){
 		na_object_profile_set_path( profile, path );
@@ -635,6 +633,10 @@ read_item_action_profile_properties( NAGConfProvider *provider, GSList *entries,
 		g_free( parameters );
 	}
 
+	if(( !path || !g_utf8_strlen( path, -1 )) && ( !parameters || !g_utf8_strlen( parameters, -1 ))){
+		g_warning( "%s: no path nor parameters found for NAObjectProfile %p", thisfn, ( void * ) profile );
+	}
+
 	if( na_gconf_utils_get_string_list_from_entries( entries, ACTION_BASENAMES_ENTRY, &basenames )){
 		na_object_profile_set_basenames( profile, basenames );
 		na_utils_free_string_list( basenames );



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