Re: adress book doesn't work anymore




Did a litle hack with it!

Apply this litle patch to your balsa, and then all your "EMAIL:<some
type>" will be added.

It will be added like this:
  Jon Doe (INTERNET)	Jon.Doe@internet.net
  Jon Dear (AOL)	Jon.Dear@aol.org
  Jon Doe (INTERNET)	Jon.Doe@local.net

Or what ever.

The type was just somehing I put in there to tell the different adresses
apart from each other. The bad thing is that it will show in the heading
when sending mail as well.

Well, If someone like it and would like to commit it while I'm gone,
please do so. Otherwise may do it later. The name layout may be changed to
something more convenient.

-Ragnar-

Index: balsa/src/address-book.c
===================================================================
RCS file: /cvs/gnome/balsa/src/address-book.c,v
retrieving revision 1.5
diff -u -r1.5 address-book.c
--- balsa/src/address-book.c	1999/12/14 18:58:55	1.5
+++ balsa/src/address-book.c	1999/12/14 23:03:41
@@ -188,8 +188,10 @@
 ab_load(GtkWidget * widget, gpointer data) 
 { 
 	FILE *gc; 
-	gchar name[256], 
-		email[256], 
+	gchar name[256],
+		newname[256],
+		email[256],
+		type[256],
 		string[256], 
 		*listdata[2]; 
 	gint got_name = FALSE; 
@@ -221,11 +223,16 @@
 				i = -1;
 			} 
 
-			if (sscanf(string, N_("EMAIL;INTERNET:%s\n"), email)) { 
-				int rownum; 
+			if (sscanf(string, "EMAIL;%s\n", type)) { 
+				gint rownum; 
+				gint i = -1;
 				AddressData *data = g_malloc(sizeof(AddressData)); 
-			
-				listdata[0] = got_name ? strdup(name) : strdup(N_("No-Name")); 
+				
+				while ( type[++i] != ':' );
+				strcpy(email, &type[i+1]);
+				type[i] = '\0';
+				snprintf(newname, sizeof(name), "%s (%s)", name, type);
+				listdata[0] = got_name ? strdup(newname) : strdup(N_("No-Name")); 
 				listdata[1] = strdup(email); 
 
 				data->name = listdata[0]; 


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