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



Author: hadess
Date: Sun Jan 20 13:58:46 2008
New Revision: 275
URL: http://svn.gnome.org/viewvc/nautilus-sendto?rev=275&view=rev

Log:
2008-01-20  Bastien Nocera  <hadess hadess net>

	* src/nautilus-sendto-command.c: (nautilus_sendto_plugin_init):
	Try loading files from the uninstalled path when running in the
	source tree
	* src/plugins/evolution.c: (contacts_selected_cb),
	(state_change_cb), (send_files), (destroy): Save the contact name
	when it's selected, and use it in the command-line so it appears
	in the evolution To: line (Closes: #378108)



Modified:
   trunk/ChangeLog
   trunk/src/nautilus-sendto-command.c
   trunk/src/plugins/evolution.c

Modified: trunk/src/nautilus-sendto-command.c
==============================================================================
--- trunk/src/nautilus-sendto-command.c	(original)
+++ trunk/src/nautilus-sendto-command.c	Sun Jan 20 13:58:46 2008
@@ -37,6 +37,8 @@
 #define NAUTILUS_SENDTO_LAST_COMPRESS	NAUTILUS_SENDTO_GCONF"/last_compress"
 #define NAUTILUS_SENDTO_STATUS_LABEL_TIMEOUT 10000
 
+#define UNINSTALLED_PLUGINDIR "plugins/.libs"
+
 /* Options */
 static gchar *default_url = NULL;
 static char **filenames = NULL;
@@ -564,8 +566,14 @@
 	NstPlugin *p = NULL;
 	gboolean (*nst_init_plugin)(NstPlugin *p);
 	GError *err = NULL;
+	const char *plugindir;
+
+	if (g_file_test (UNINSTALLED_PLUGINDIR, G_FILE_TEST_IS_DIR) != FALSE)
+		plugindir = UNINSTALLED_PLUGINDIR;
+	else
+		plugindir = PLUGINDIR;
 
-	dir = g_dir_open (PLUGINDIR, 0, &err);
+	dir = g_dir_open (plugindir, 0, &err);
 
 	if (dir == NULL) {
 		g_warning ("Can't open the plugins dir: %s", err ? err->message : "No reason");
@@ -578,7 +586,7 @@
 				char *module_path;
 
 				p = g_new0(NstPlugin, 1);
-				module_path = g_module_build_path (PLUGINDIR, item);
+				module_path = g_module_build_path (plugindir, item);
 				p->module = g_module_open (module_path, G_MODULE_BIND_LAZY);
 			        if (!p->module) {
                 			g_warning ("error opening %s: %s", module_path, g_module_error ());

Modified: trunk/src/plugins/evolution.c
==============================================================================
--- trunk/src/plugins/evolution.c	(original)
+++ trunk/src/plugins/evolution.c	Sun Jan 20 13:58:46 2008
@@ -35,6 +35,7 @@
 
 static char *evo_cmd = NULL;
 static char *email = NULL;
+static char *name = NULL;
 
 static 
 gboolean init (NstPlugin *plugin)
@@ -74,6 +75,7 @@
 	char *text;
 
 	email = e_contact_get (contact, E_CONTACT_EMAIL_1);
+	name = e_contact_get (contact, E_CONTACT_NAME_OR_ORG);
 
 	text = g_strdup_printf (CONTACT_FORMAT, (char*)e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG), email);
 	gtk_entry_set_text (GTK_ENTRY (entry), text);
@@ -86,6 +88,8 @@
 	if (state == FALSE) {
 		g_free (email);
 		email = NULL;
+		g_free (name);
+		name = NULL;
 	}
 }
 
@@ -149,7 +153,10 @@
 	mailto = g_string_new ("mailto:";);
 
 	if (email != NULL) {
-		g_string_append_printf (mailto, "%s", email);
+		if (name != NULL)
+			g_string_append_printf (mailto, "\""CONTACT_FORMAT"\"", name, email);
+		else
+			g_string_append_printf (mailto, "%s", email);
 	}else{
 		const char *text;
 
@@ -175,6 +182,10 @@
 gboolean destroy (NstPlugin *plugin){
 	g_free (evo_cmd);
 	evo_cmd = NULL;
+	g_free (name);
+	name = NULL;
+	g_free (email);
+	email = NULL;
 	return TRUE;
 }
 



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