Index: src/plugins/sylpheed-claws.c
===================================================================
RCS file: /cvs/gnome/nautilus-sendto/src/plugins/sylpheed-claws.c,v
retrieving revision 1.3
diff -u -p -u -r1.3 sylpheed-claws.c
--- src/plugins/sylpheed-claws.c	21 Aug 2006 13:37:59 -0000	1.3
+++ src/plugins/sylpheed-claws.c	17 Dec 2006 12:22:44 -0000
@@ -27,24 +27,34 @@
 
 static GHashTable *hash = NULL;
 
+static gchar *get_claws_command(void)
+{
+	gchar *sc_cmd = NULL;
+
+	sc_cmd = g_find_program_in_path ("claws-mail");
+	if (sc_cmd == NULL)
+		sc_cmd = g_find_program_in_path ("sylpheed-claws-gtk2");
+	if (sc_cmd == NULL)
+		sc_cmd = g_find_program_in_path ("sylpheed-claws");
+	if (sc_cmd == NULL)
+		sc_cmd = g_find_program_in_path ("sylpheed");
+	return sc_cmd;
+}
+
 static 
 gboolean init (NstPlugin *plugin)
 {
-	gchar *sc_cmd;
-	
+	gchar *sc_cmd = NULL;
 	printf ("Init sylpheed-claws plugin\n");
 	hash = g_hash_table_new (g_str_hash, g_str_equal);
 
-	sc_cmd = g_find_program_in_path ("sylpheed-claws-gtk2");
-	if (sc_cmd == NULL){
-		sc_cmd = g_find_program_in_path ("sylpheed-claws");
-		if (sc_cmd == NULL)
-			sc_cmd = g_find_program_in_path ("sylpheed");
-	}
+	sc_cmd = get_claws_command();
 	
 	if(sc_cmd == NULL)
 		return FALSE;
 
+	g_free(sc_cmd);
+
 	return TRUE;
 }
 
@@ -80,15 +90,11 @@ gboolean send_files (NstPlugin *plugin, 
 		g_string_append_printf (mailto, "%s", send_to);		
 	}
 	
-	sc_cmd = g_find_program_in_path ("sylpheed-claws-gtk2");
-	if (sc_cmd == NULL){
-		sc_cmd = g_find_program_in_path ("sylpheed-claws");
-		if (sc_cmd == NULL)
-			sc_cmd = g_find_program_in_path ("sylpheed");
-	}
+	sc_cmd = get_claws_command();
 	
 	if(sc_cmd == NULL)
 		return FALSE;
+
 	/* tmp_str is used for delete file:/// at the start of the filename path */
 	tmp_str = g_filename_from_uri(file_list->data, NULL, NULL);
 	g_string_append_printf (mailto," --attach \"%s\"",tmp_str);
@@ -116,7 +122,7 @@ static 
 NstPluginInfo plugin_info = {
 	"stock_mail",
 	"sylpheed-claws",
-	N_("Email (Sylpheed-Claws)"),
+	N_("Email (Claws Mail)"),
 	FALSE,
 	init,
 	get_contacts_widget,
