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 46459cb9dd4e701ca8c79ed8a1123d6c39306474..b364f0a0c300bf33510ec6c576e08d4776a912f7 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 8e832ed4881abb7ebf6994407c2e7c07a83614bc..a87f9140f80e57896d02c61cd5cf0121ffd86adf 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 cd94fb0572ef3e14340e9e499f0c01bd3559611a..6ee036fa14d6aa804089e7aceb81ee1fbc03a88f 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 b0f24fac1cbecabeeac1357aa0e7ec65012e59b3..4350bf2531a9fe14bd13652392b68cef882d21f0 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 03a13bb626d00aa4d8749a6a2b3afeffd2264e3e..863a8b0a2389297cc43e8f54737b51735fcc5bd2 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 a0eb51a913037d429151eea8c86bb7d13b3bd83d..0793512322dbf6d5e4f692213dcb554f8ee1134c 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 );