nautilus-sendto r315 - in trunk: . src src/plugins



Author: hadess
Date: Thu Mar 27 18:29:07 2008
New Revision: 315
URL: http://svn.gnome.org/viewvc/nautilus-sendto?rev=315&view=rev

Log:
2008-03-27  Bastien Nocera  <hadess hadess net>

	* configure.in: Allow distributors to override the
	default thunderbird binary name with
	--with-thunderbird-name=XXX, enable the thunderbird
	plugin by default

	* src/nautilus-sendto-command.c (send_button_cb):
	Fix a memory leak

	* src/plugins/thunderbird.c (init), (send_files):
	Attachments are passed as URIs, so quote them as
	expected

	(Closes: #356258)



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/nautilus-sendto-command.c
   trunk/src/plugins/thunderbird.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Thu Mar 27 18:29:07 2008
@@ -29,7 +29,8 @@
 GAIM_REQUIRED=1.5.0
 PIDGIN_REQUIRED=2.0.0
 NAUTILUS_EXTENSION=2.13.3
-DBUS_REQUIRED=0.60
+DBUS_REQUIRED=1.0
+DBUS_GLIB_REQUIRED=0.60
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GTK_REQUIRED)
@@ -131,7 +132,7 @@
 dnl Bluetooth support if it's installed
 dnl -----------------------------------
 
-PKG_CHECK_MODULES(BLUETOOTH, dbus-glib-1 >= $DBUS_REQUIRED,
+PKG_CHECK_MODULES(BLUETOOTH, dbus-glib-1 >= $DBUS_GLIB_REQUIRED,
 	[
 	AC_SUBST(BLUETOOTH_CFLAGS)
 	AC_SUBST(BLUETOOTH_LIBS)
@@ -169,8 +170,21 @@
 dnl Thunderbird support
 dnl -------------------------------------------------
 
-enable_thunderbird=no
+AC_ARG_WITH([thunderbird-name],
+	    [AS_HELP_STRING([--with-thunderbird-name],[Binary name for Thunderbird (default: thunderbird)])],
+	    [with_thunderbird_name=$withval])
+if test "x$with_thunderbird_name" = "x" ; then
+	with_thunderbird_name=thunderbird
+fi
+
+THUNDERBIRD_NAME=$with_thunderbird_name
+AC_SUBST(THUNDERBIRD_NAME)
+
+AC_DEFINE_UNQUOTED(THUNDERBIRD_NAME, "$THUNDERBIRD_NAME", [name of the Thunderbird binary])
+
+enable_thunderbird=yes
 AM_CONDITIONAL(HAVE_THUNDERBIRD, test "x$enable_thunderbird" = "xyes")
+
 dnl -------------------------------------------------
 
 dnl Gajim support
@@ -182,7 +196,7 @@
 
 GAJIM_SHARE_DIR="$GAJIM_PATH"/share/gajim
 
-PKG_CHECK_MODULES(DBUS, dbus-1 >= $DBUS_REQUIRED dbus-glib-1 >= $DBUS_REQUIRED,
+PKG_CHECK_MODULES(DBUS, dbus-1 >= $DBUS_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED,
         [
         AC_SUBST(DBUS_CFLAGS)
         AC_SUBST(DBUS_LIBS)
@@ -265,15 +279,15 @@
 fi
 
 if test "x${enable_thunderbird}" = "xyes" ; then
-   echo " **  Enable thunderbird plugin : YES"
+   echo " **  Enable thunderbird plugin : YES (binary name: $THUNDERBIRD_NAME)"
 else
-   echo "     Enable thunderbird plugin (under development, don't support attachments) : NO"
+   echo "     Enable thunderbird plugin : NO"
 fi
 
 if test "x${enable_gajim}" = "xyes" ; then
    echo " **  Enable gajim plugin : YES"
 else
-   echo " **  Enable gajim plugin : NO"
+   echo "     Enable gajim plugin : NO"
 fi
 
 echo "                                                       "

Modified: trunk/src/nautilus-sendto-command.c
==============================================================================
--- trunk/src/nautilus-sendto-command.c	(original)
+++ trunk/src/nautilus-sendto-command.c	Thu Mar 27 18:29:07 2008
@@ -341,6 +341,7 @@
 			}
 		}else{
 			if (!p->info->send_files (p, w, file_list)) {
+				g_list_foreach (file_list, (GFunc) g_free, NULL);
 				g_list_free (file_list);
 				file_list = NULL;
 				return;

Modified: trunk/src/plugins/thunderbird.c
==============================================================================
--- trunk/src/plugins/thunderbird.c	(original)
+++ trunk/src/plugins/thunderbird.c	Thu Mar 27 18:29:07 2008
@@ -37,9 +37,11 @@
 	printf ("Init thunderbird plugin\n");
 	hash = g_hash_table_new (g_str_hash, g_str_equal);
 
-	t_cmd = g_find_program_in_path ("mozilla-thunderbird");
+	t_cmd = g_find_program_in_path (THUNDERBIRD_NAME);
 	if (t_cmd == NULL)
 		return FALSE;
+	g_free (t_cmd);
+
 	return TRUE;
 }
 
@@ -74,14 +76,15 @@
 		g_string_append_printf (mailto, "to=%s,", send_to);		
 	}
 	
-	t_cmd = g_find_program_in_path ("mozilla-thunderbird");
+	t_cmd = g_find_program_in_path (THUNDERBIRD_NAME);
 	if (t_cmd == NULL)
 		return FALSE;
 	
-	g_string_append_printf (mailto," attachment='\"%s\"'",file_list->data);
+	g_string_append_printf (mailto,"attachment='%s", (char *) file_list->data);
 	for (l = file_list->next ; l; l=l->next){				
-		g_string_append_printf (mailto,",'\"%s\"'",l->data);
+		g_string_append_printf (mailto,",%s", (char *) l->data);
 	}
+	g_string_append_c (mailto, '\'');
 	cmd = g_strdup_printf ("%s %s", t_cmd, mailto->str);
 	g_spawn_command_line_async (cmd, NULL);
 	g_free (cmd);



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