2011-04-08 [colin] 3.7.8cvs75
authorColin Leroy <colin@colino.net>
Fri, 8 Apr 2011 16:55:53 +0000 (16:55 +0000)
committerColin Leroy <colin@colino.net>
Fri, 8 Apr 2011 16:55:53 +0000 (16:55 +0000)
* src/account.c
* src/folder.c
* src/folder.h
* src/folder_item_prefs.c
* src/folder_item_prefs.h
* src/prefs_account.c
Fix bug #2382, "folderitemrc not updated when account
name is changed". Indeed, this wasn't done.

ChangeLog
PATCHSETS
configure.ac
src/account.c
src/folder.c
src/folder.h
src/folder_item_prefs.c
src/folder_item_prefs.h
src/prefs_account.c

index 95a37d8..0867873 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-04-08 [colin]     3.7.8cvs75
+
+       * src/account.c
+       * src/folder.c
+       * src/folder.h
+       * src/folder_item_prefs.c
+       * src/folder_item_prefs.h
+       * src/prefs_account.c
+               Fix bug #2382, "folderitemrc not updated when account
+               name is changed". Indeed, this wasn't done.
+
 2011-04-08 [wwp]       3.7.8cvs74
 
        * src/procmime.c
index 9fffd93..17b1ff8 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.569 -r 1.382.2.570 src/compose.c;  ) > 3.7.8cvs72.patchset
 ( cvs diff -u -r 1.2.2.42 -r 1.2.2.43 src/gtk/filesel.c;  ) > 3.7.8cvs73.patchset
 ( cvs diff -u -r 1.49.2.139 -r 1.49.2.140 src/procmime.c;  ) > 3.7.8cvs74.patchset
+( cvs diff -u -r 1.61.2.96 -r 1.61.2.97 src/account.c;  cvs diff -u -r 1.213.2.200 -r 1.213.2.201 src/folder.c;  cvs diff -u -r 1.87.2.63 -r 1.87.2.64 src/folder.h;  cvs diff -u -r 1.2.2.36 -r 1.2.2.37 src/folder_item_prefs.c;  cvs diff -u -r 1.2.2.23 -r 1.2.2.24 src/folder_item_prefs.h;  cvs diff -u -r 1.105.2.165 -r 1.105.2.166 src/prefs_account.c;  ) > 3.7.8cvs75.patchset
index 0a63eb3..32e6c65 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=74
+EXTRA_VERSION=75
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index cae5d80..25171a6 100644 (file)
@@ -461,6 +461,7 @@ void account_open(PrefsAccount *ac_prefs)
                        folder_set_name(FOLDER(ac_prefs->folder),
                                        ac_prefs->account_name);
                        folderview_set_all();
+                       folder_prefs_save_config_recursive(FOLDER(ac_prefs->folder));
                }
 
                account_write_config_all();
index dccd79a..ac6828f 100644 (file)
@@ -1380,6 +1380,40 @@ gchar *folder_item_get_identifier(FolderItem *item)
        return id;
 }
 
+Folder *folder_find_from_identifier(const gchar *identifier)
+{
+       Folder *folder;
+       gpointer d[2];
+       gchar *str;
+       gchar *p;
+       gchar *name;
+       gchar *path;
+       FolderClass *class;
+
+       cm_return_val_if_fail(identifier != NULL, NULL);
+
+       if (*identifier != '#')
+               return NULL;
+
+       Xstrdup_a(str, identifier, return NULL);
+
+       p = strchr(str, '/');
+       if (!p)
+               return NULL;
+       *p = '\0';
+       p++;
+       class = folder_get_class_from_string(&str[1]);
+       if (class == NULL)
+               return NULL;
+
+       name = p;
+       p = strchr(p, '/');
+       if (p)
+               return NULL;
+
+       return folder_find_from_name(name, class);
+}
+
 FolderItem *folder_find_item_from_identifier(const gchar *identifier)
 {
        Folder *folder;
index a18b7c4..85951c7 100644 (file)
@@ -788,6 +788,7 @@ void folder_count_total_msgs(guint *new_msgs, guint *unread_msgs,
 gchar *folder_get_status       (GPtrArray      *folders,
                                 gboolean        full);
 
+Folder            *folder_find_from_identifier         (const gchar *identifier);
 Folder     *folder_find_from_path              (const gchar    *path);
 Folder     *folder_find_from_name              (const gchar    *name,
                                                 FolderClass    *klass);
index e75d9ab..676d351 100644 (file)
@@ -146,7 +146,10 @@ void folder_item_prefs_save_config(FolderItem * item)
        tmp_prefs = * item->prefs;
 
        id = folder_item_get_identifier(item);
-       debug_print("saving prefs for %s\n", id?id:"(null)");
+       if (id == NULL)
+               return;
+
+       debug_print("saving prefs for %s\n", id);
        prefs_write_config(param, id, FOLDERITEM_RC);
        g_free(id);
 }
@@ -164,6 +167,12 @@ void folder_item_prefs_save_config_recursive(FolderItem * item)
                        -1, folder_item_prefs_save_config_func, NULL);
 }
 
+void folder_prefs_save_config_recursive(Folder *folder)
+{      
+       g_node_traverse(folder->node, G_PRE_ORDER, G_TRAVERSE_ALL,
+                       -1, folder_item_prefs_save_config_func, NULL);
+}
+
 static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs)
 {
        prefs->enable_default_to = FALSE;
index 223d4c6..9fd7550 100644 (file)
@@ -84,6 +84,7 @@ struct _FolderItemPrefs {
 void folder_item_prefs_read_config(FolderItem * item);
 void folder_item_prefs_save_config(FolderItem * item);
 void folder_item_prefs_save_config_recursive(FolderItem * item);
+void folder_prefs_save_config_recursive(Folder *folder);
 FolderItemPrefs *folder_item_prefs_new(void);
 void folder_item_prefs_free(FolderItemPrefs * prefs);
 void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest);
index cac0d7c..705e66b 100644 (file)
@@ -2888,14 +2888,14 @@ static gint prefs_basic_apply(void)
        
        if (protocol == A_IMAP4 || protocol == A_NNTP) 
                old_id = g_strdup_printf("#%s/%s",
-                               protocol == A_IMAP4 ? "imap":"nntp",
+                               protocol == A_IMAP4 ? "imap":"news",
                                tmp_ac_prefs.account_name ? tmp_ac_prefs.account_name : "(null)");
        
        prefs_set_data_from_dialog(basic_param);
        
        if (protocol == A_IMAP4 || protocol == A_NNTP) {
                new_id = g_strdup_printf("#%s/%s",
-                               protocol == A_IMAP4 ? "imap":"nntp",
+                               protocol == A_IMAP4 ? "imap":"news",
                                tmp_ac_prefs.account_name);
                if (old_id != NULL && new_id != NULL)
                        prefs_filtering_rename_path(old_id, new_id);