2011-11-28 [pawel] 3.7.10cvs106
authorPaweł Pękala <c0rn@gazeta.pl>
Mon, 28 Nov 2011 21:47:34 +0000 (21:47 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Mon, 28 Nov 2011 21:47:34 +0000 (21:47 +0000)
* 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'

ChangeLog
PATCHSETS
configure.ac
src/addrbook.c
src/addrbook.h
src/addressbook.c

index 46459cb..b364f0a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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'
+
 2011-11-26 [pawel]     3.7.10cvs105
 
        * src/folder.c
index 8e832ed..a87f914 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.59.2.87 -r 1.59.2.88 src/prefs_filtering.c;  ) > 3.7.10cvs103.patchset
 ( cvs diff -u -r 1.1.2.68 -r 1.1.2.69 src/imap_gtk.c;  cvs diff -u -r 1.2.2.40 -r 1.2.2.41 src/mh_gtk.c;  ) > 3.7.10cvs104.patchset
 ( cvs diff -u -r 1.213.2.203 -r 1.213.2.204 src/folder.c;  ) > 3.7.10cvs105.patchset
+( cvs diff -u -r 1.22.2.25 -r 1.22.2.26 src/addrbook.c;  cvs diff -u -r 1.7.2.4 -r 1.7.2.5 src/addrbook.h;  cvs diff -u -r 1.60.2.146 -r 1.60.2.147 src/addressbook.c;  ) > 3.7.10cvs106.patchset
index cd94fb0..6ee036f 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=105
+EXTRA_VERSION=106
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b0f24fa..4350bf2 100644 (file)
@@ -2235,6 +2235,19 @@ gchar *addrbook_guess_next_file(AddressBookFile *book)
        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 03a13bb..863a8b0 100644 (file)
@@ -104,5 +104,6 @@ ItemPerson *addrbook_add_contact    ( AddressBookFile *book, ItemFolder *folder,
                                          const gchar *remarks );
 
 gchar *addrbook_guess_next_file                ( AddressBookFile *book );
+void addrbook_delete_book_file         ( AddressBookFile *book );
 
 #endif /* __ADDRBOOK_H__ */
index a0eb51a..0793512 100644 (file)
@@ -2948,7 +2948,11 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
        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 );