[nautilus-actions] Return an empty string rather than NULL



commit 0f3cec90dc7a948dad86d3d29428b5086c62a8cc
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Dec 7 21:29:59 2009 +0100

    Return an empty string rather than NULL
    
    In NAIODesktopProvider, return an empty string when the key is not found in the file.

 ChangeLog                                          |    4 ++++
 .../io-provider-desktop/nadp-desktop-file.c        |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 62aca51..9ff5292 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-12-07 Pierre Wieser <pwieser trychlos org>
 
+	* nautilus-actions/io-provider-desktop/nadp-desktop-file.c
+	(nadp_desktop_file_get_label, nadp_desktop_file_get_tooltip,
+	nadp_desktop_file_get_icon): Return an empty string rather than NULL.
+
 	* nautilus-actions/nact/nact-main-menubar.c (on_update_sensitivities):
 	Do not paste into a read-only action.
 
diff --git a/nautilus-actions/io-provider-desktop/nadp-desktop-file.c b/nautilus-actions/io-provider-desktop/nadp-desktop-file.c
index ff86bee..69a7bf6 100644
--- a/nautilus-actions/io-provider-desktop/nadp-desktop-file.c
+++ b/nautilus-actions/io-provider-desktop/nadp-desktop-file.c
@@ -366,6 +366,10 @@ nadp_desktop_file_get_label( const NadpDesktopFile *ndf )
 	if( !ndf->private->dispose_has_run ){
 		label = g_key_file_get_locale_string(
 				ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL );
+
+		if( !label ){
+			label = g_strdup( "" );
+		}
 	}
 
 	return( label );
@@ -389,6 +393,10 @@ nadp_desktop_file_get_tooltip( const NadpDesktopFile *ndf )
 	if( !ndf->private->dispose_has_run ){
 		tooltip = g_key_file_get_locale_string(
 				ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_COMMENT, NULL, NULL );
+
+		if( !tooltip ){
+			tooltip = g_strdup( "" );
+		}
 	}
 
 	return( tooltip );
@@ -412,6 +420,10 @@ nadp_desktop_file_get_icon( const NadpDesktopFile *ndf )
 	if( !ndf->private->dispose_has_run ){
 		icon = g_key_file_get_locale_string(
 				ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL, NULL );
+
+		if( !icon ){
+			icon = g_strdup( "" );
+		}
 	}
 
 	return( icon );



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