[Commits] addrbook.c 1.22.2.25 1.22.2.26 addrbook.h 1.7.2.4 1.7.2.5 addressbook.c 1.60.2.146 1.60.2.147

pawel at claws-mail.org pawel at claws-mail.org
Mon Nov 28 22:47:35 CET 2011


Update of /home/claws-mail/claws/src
In directory claws-mail:/tmp/cvs-serv10132/src

Modified Files:
      Tag: gtk2
	addrbook.c addrbook.h addressbook.c 
Log Message:
2011-11-28 [pawel]	3.7.10cvs106

	* src/addrbook.c
	* src/addrbook.h
	* src/addressbook.c
		Fix bug #2177 'addrbook/addrbook-00000?.xml is not deleted
		after removing the address book in the GUI'

Index: addrbook.c
===================================================================
RCS file: /home/claws-mail/claws/src/addrbook.c,v
retrieving revision 1.22.2.25
retrieving revision 1.22.2.26
diff -u -d -r1.22.2.25 -r1.22.2.26
--- addrbook.c	17 Oct 2011 11:02:44 -0000	1.22.2.25
+++ addrbook.c	28 Nov 2011 21:47:33 -0000	1.22.2.26
@@ -2235,6 +2235,19 @@
 	return newFile;
 }
 
+void addrbook_delete_book_file(AddressBookFile *book)
+{
+	gchar *book_path;
+	
+	if (!book->path || !book->fileName)
+		return;
+	
+	book_path = g_strconcat(book->path, G_DIR_SEPARATOR_S,
+				book->fileName, NULL);
+	claws_unlink(book_path);
+	g_free(book_path);
+}
+
 /*
 * End of Source.
 */

Index: addrbook.h
===================================================================
RCS file: /home/claws-mail/claws/src/addrbook.h,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -u -d -r1.7.2.4 -r1.7.2.5
--- addrbook.h	11 Jul 2007 16:32:46 -0000	1.7.2.4
+++ addrbook.h	28 Nov 2011 21:47:33 -0000	1.7.2.5
@@ -104,5 +104,6 @@
 					  const gchar *remarks );
 
 gchar *addrbook_guess_next_file		( AddressBookFile *book );
+void addrbook_delete_book_file		( AddressBookFile *book );
 
 #endif /* __ADDRBOOK_H__ */

Index: addressbook.c
===================================================================
RCS file: /home/claws-mail/claws/src/addressbook.c,v
retrieving revision 1.60.2.146
retrieving revision 1.60.2.147
diff -u -d -r1.60.2.146 -r1.60.2.147
--- addressbook.c	23 Oct 2011 20:50:47 -0000	1.60.2.146
+++ addressbook.c	28 Nov 2011 21:47:33 -0000	1.60.2.147
@@ -2948,7 +2948,11 @@
 	if( obj->type == ADDR_DATASOURCE ) {
 		/* Remove node from tree */
 		gtk_cmctree_remove_node( ctree, node );
-	
+		
+		if (delType == ADDRTREE_DEL_DATA &&
+		    ds->interface && ds->interface->type == ADDR_IF_BOOK)
+			addrbook_delete_book_file((AddressBookFile *) ds->rawDataSource);
+			
 		/* Remove data source. */
 		if( addrindex_index_remove_datasource( _addressIndex_, ds ) ) {
 			addrindex_free_datasource( ds );



More information about the Commits mailing list