[nautilus-actions] Fix warning when the loaded profile is invalid



commit 4153fc029581afb17ff65fd2e0bd11eb5f12949c
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Oct 9 17:26:28 2009 +0200

    Fix warning when the loaded profile is invalid

 src/runtime/na-gconf-provider.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/runtime/na-gconf-provider.c b/src/runtime/na-gconf-provider.c
index f6a0000..a218e93 100644
--- a/src/runtime/na-gconf-provider.c
+++ b/src/runtime/na-gconf-provider.c
@@ -620,23 +620,28 @@ read_item_action_profile_properties( NAGConfProvider *provider, GSList *entries,
 
 	if( na_gconf_utils_get_string_from_entries( entries, ACTION_PROFILE_LABEL_ENTRY, &label )){
 		na_object_set_label( profile, label );
-		g_free( label );
 	}
 
+	path = NULL;
 	if( na_gconf_utils_get_string_from_entries( entries, ACTION_PATH_ENTRY, &path )){
 		na_object_profile_set_path( profile, path );
-		g_free( path );
 	}
 
+	parameters = NULL;
 	if( na_gconf_utils_get_string_from_entries( entries, ACTION_PARAMETERS_ENTRY, &parameters )){
 		na_object_profile_set_parameters( profile, parameters );
-		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 );
+		g_warning(
+				"%s: no path nor parameters found for NAObjectProfile %p \"%s\"",
+				thisfn, ( void * ) profile, label );
 	}
 
+	g_free( label );
+	g_free( path );
+	g_free( parameters );
+
 	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]