2006-03-07 [paul] 2.0.0cvs118
authorPaul Mangan <paul@claws-mail.org>
Tue, 7 Mar 2006 09:35:31 +0000 (09:35 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 7 Mar 2006 09:35:31 +0000 (09:35 +0000)
* src/news.c
* src/news_gtk.c
when unsubscribing a newsgroup, remove the
folder and msgs in .sylpheed-claws/newscache
Patch by Pawel Pekala <c0rn@gazeta.pl>

ChangeLog
PATCHSETS
configure.ac
src/news.c
src/news_gtk.c

index cbc0973..c00fda3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-07 [paul]      2.0.0cvs118
+
+       * src/news.c
+       * src/news_gtk.c
+               when unsubscribing a newsgroup, remove the
+               folder and msgs in .sylpheed-claws/newscache
+               Patch by Pawel Pekala <c0rn@gazeta.pl>
+
 2006-03-07 [paul]      2.0.0cvs117
 
        * src/textview.c
index 5bfca31..2a1b40c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.97 -r 1.179.2.98 src/imap.c;  ) > 2.0.0cvs115.patchset
 ( cvs diff -u -r 1.179.2.98 -r 1.179.2.99 src/imap.c;  cvs diff -u -r 1.2.2.15 -r 1.2.2.16 src/gtk/inputdialog.c;  ) > 2.0.0cvs116.patchset
 ( cvs diff -u -r 1.96.2.99 -r 1.96.2.100 src/textview.c;  ) > 2.0.0cvs117.patchset
+( cvs diff -u -r 1.101.2.22 -r 1.101.2.23 src/news.c;  cvs diff -u -r 1.2.2.16 -r 1.2.2.17 src/news_gtk.c;  ) > 2.0.0cvs118.patchset
index dedfd78..488c83f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=117
+EXTRA_VERSION=118
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 1ef6710..dd91686 100644 (file)
@@ -138,6 +138,8 @@ static void news_synchronise                 (FolderItem    *item);
 static int news_dummy_remove            (Folder        *folder, 
                                          FolderItem    *item, 
                                          gint           msgnum);
+static gint news_remove_folder          (Folder        *folder,
+                                         FolderItem    *item);
 static FolderClass news_class;
 
 FolderClass *news_get_class(void)
@@ -155,6 +157,7 @@ FolderClass *news_get_class(void)
                news_class.item_get_path = news_item_get_path;
                news_class.get_num_list = news_get_num_list;
                news_class.scan_required = news_scan_required;
+               news_class.remove_folder = news_remove_folder;
 
                /* Message functions */
                news_class.get_msginfo = news_get_msginfo;
@@ -1209,3 +1212,23 @@ void news_synchronise(FolderItem *item)
 {
        news_gtk_synchronise(item);
 }
+
+static gint news_remove_folder(Folder *folder, FolderItem *item)
+{
+       gchar *path;
+
+       g_return_val_if_fail(folder != NULL, -1);
+       g_return_val_if_fail(item != NULL, -1);
+       g_return_val_if_fail(item->path != NULL, -1);
+
+       path = folder_item_get_path(item);
+       if (remove_dir_recursive(path) < 0) {
+               g_warning("can't remove directory `%s'\n", path);
+               g_free(path);
+               return -1;
+       }
+
+       g_free(path);
+       folder_item_remove(item);
+       return 0;
+}
index c0bbea1..7eba093 100644 (file)
@@ -233,7 +233,13 @@ static void unsubscribe_newsgroup_cb(FolderView *folderview, guint action,
                folderview->opened = NULL;
        }
 
-       folder_item_remove(item);
+       if(item->folder->klass->remove_folder(item->folder, item) < 0) {
+               folder_item_scan(item);
+               alertpanel_error(_("Can't remove the folder '%s'."), name);
+               g_free(old_id);
+               return;
+       }
+       
        folder_write_list();
        
        prefs_filtering_delete_path(old_id);