* sync with main changes of 2002-10-07
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 13 Oct 2002 15:43:22 +0000 (15:43 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 13 Oct 2002 15:43:22 +0000 (15:43 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/account.c
src/account.h
src/folder.c
src/folder.h
src/folderview.c
src/mainwindow.c

index 1c028e6..2d22e6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2002-10-07
+       * src/account.[ch]: account_open(): new. It opens account prefs
+         dialog and reflects to UI when finished.
+       * src/folderview.c:
+         folderview_button_pressed()
+         folderview_property_cb(): open account prefs dialog when the
+         property of the root folder of remote account is requested.
+
+2002-10-07
+
+       * src/account.c: account_destroy(): unref account information in
+         folders.
+       * src/folder.[ch]: folder_unref_account_all(): new. It unref the
+         specified account information in all folders.
+       * src/folderview.c:
+         folderview_rm_imap_server_cb()
+         folderview_rm_news_server_cb(): destroy Folder first because
+         folder_destroy() refers to account information.
+
 2002-10-04
 
        * src/account.c: account_find_from_item(): fixed a bug which didn't
index dc4ad80..6dbb9ae 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-12 [alfons]    0.8.5claws28
+       
+       * sync with main changes of 2002-10-07
+
 2002-10-12 [alfons]    0.8.5claws27
 
        * sync with main changes of 2002-10-04
index 3452a8b..28c80cf 100644 (file)
@@ -1,3 +1,23 @@
+2002-10-07
+       * src/account.[ch]: account_open(): ¿·µ¬¡£¥¢¥«¥¦¥ó¥ÈÀßÄê¥À¥¤¥¢¥í¥°
+         ¤ò³«¤­¡¢½ªÎ»»þ¤Ë UI ¤ËÈ¿±Ç¤µ¤»¤ë¡£
+       * src/folderview.c:
+         folderview_button_pressed()
+         folderview_property_cb(): ¥ê¥â¡¼¥È¥¢¥«¥¦¥ó¥È¤Î¥ë¡¼¥È¥Õ¥©¥ë¥À¤Î
+         ¥×¥í¥Ñ¥Æ¥£¤òÍ׵ᤵ¤ì¤¿¤é¥¢¥«¥¦¥ó¥ÈÀßÄê¥À¥¤¥¢¥í¥°¤ò³«¤¯¤è¤¦¤Ë¤·¤¿¡£
+
+2002-10-07
+
+       * src/account.c: account_destroy(): ¥Õ¥©¥ë¥ÀÃæ¤Î¥¢¥«¥¦¥ó¥È¾ðÊó¤Ø¤Î
+         »²¾È¤ò²ò½ü¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/folder.[ch]: folder_unref_account_all(): ¿·µ¬¡£Á´¥Õ¥©¥ë¥ÀÃæ
+         ¤Î»ØÄꤷ¤¿¥¢¥«¥¦¥ó¥È¾ðÊó¤Ø¤Î»²¾È¤ò²ò½ü¤¹¤ë¡£
+       * src/folderview.c:
+         folderview_rm_imap_server_cb()
+         folderview_rm_news_server_cb(): folder_destroy() ¤¬¥¢¥«¥¦¥ó¥È¾ðÊó
+         ¤ò»²¾È¤·¤Æ¤¤¤ë¤¿¤á Folder ¤òÀè¤Ëºï½ü¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2002-10-04
 
        * src/account.c: account_find_from_item(): Àµ¤·¤¤¥¢¥«¥¦¥ó¥È¤òÁªÂò
index 5aa4383..324182b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws27
+EXTRA_VERSION=claws28
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 37f84e2..6b3ff20 100644 (file)
@@ -356,6 +356,33 @@ void account_add(void)
        }
 }
 
+void account_open(PrefsAccount *ac_prefs)
+{
+       gboolean prev_default;
+       gchar *ac_name;
+
+       g_return_if_fail(ac_prefs != NULL);
+
+       prev_default = ac_prefs->is_default;
+       Xstrdup_a(ac_name, ac_prefs->account_name ? ac_prefs->account_name : "",
+                 return);
+
+       prefs_account_open(ac_prefs);
+
+       if (!prev_default && ac_prefs->is_default)
+               account_set_as_default(ac_prefs);
+
+       if (ac_prefs->folder && strcmp2(ac_name, ac_prefs->account_name) != 0) {
+               folder_set_name(FOLDER(ac_prefs->folder),
+                               ac_prefs->account_name);
+               folderview_set_all();
+       }
+
+       account_save_config_all();
+       account_set_menu();
+       main_window_reflect_prefs_all();
+}
+
 void account_set_as_default(PrefsAccount *ac_prefs)
 {
        PrefsAccount *ap;
@@ -466,6 +493,8 @@ void account_destroy(PrefsAccount *ac_prefs)
 {
        g_return_if_fail(ac_prefs != NULL);
 
+       folder_unref_account_all(ac_prefs);
+
        prefs_account_free(ac_prefs);
        account_list = g_list_remove(account_list, ac_prefs);
 
@@ -655,22 +684,8 @@ static void account_edit_prefs(void)
 
        row = GPOINTER_TO_INT(clist->selection->data);
        ac_prefs = gtk_clist_get_row_data(clist, row);
-       prev_default = ac_prefs->is_default;
-       Xstrdup_a(ac_name, ac_prefs->account_name ? ac_prefs->account_name : "",
-                 return);
-
-       prefs_account_open(ac_prefs);
-
-       if (!prev_default && ac_prefs->is_default)
-               account_set_as_default(ac_prefs);
-
-       if ((ac_prefs->protocol == A_IMAP4 || ac_prefs->protocol == A_NNTP) &&
-           ac_prefs->folder && strcmp2(ac_name, ac_prefs->account_name) != 0) {
-               folder_set_name(FOLDER(ac_prefs->folder),
-                               ac_prefs->account_name);
-               folderview_set_all();
-       }
-
+       account_open(ac_prefs);
+       
        account_clist_set();
 }
 
index 47d157d..ba0e90b 100644 (file)
@@ -50,6 +50,7 @@ GList      *account_get_list          (void);
 
 void         account_edit_open         (void);
 void         account_add               (void);
+void         account_open              (PrefsAccount   *ac_prefs);
 void         account_set_as_default    (PrefsAccount   *ac_prefs);
 void         account_set_as_recv_at_get_all    (PrefsAccount   *ac_prefs);
 PrefsAccount *account_get_default      (void);
index 84918a8..aee1c4c 100644 (file)
@@ -795,6 +795,33 @@ void folder_set_missing_folders(void)
        }
 }
 
+static gboolean folder_unref_account_func(GNode *node, gpointer data)
+{
+       FolderItem *item = node->data;
+       PrefsAccount *account = data;
+
+       if (item->account == account)
+               item->account = NULL;
+
+       return FALSE;
+}
+
+void folder_unref_account_all(PrefsAccount *account)
+{
+       Folder *folder;
+       GList *list;
+
+       if (!account) return;
+
+       for (list = folder_list; list != NULL; list = list->next) {
+               folder = list->data;
+               if (folder->account == account)
+                       folder->account = NULL;
+               g_node_traverse(folder->node, G_PRE_ORDER, G_TRAVERSE_ALL, -1,
+                               folder_unref_account_func, account);
+       }
+}
+
 #undef CREATE_FOLDER_IF_NOT_EXIST
 
 gchar *folder_get_path(Folder *folder)
index d0862c2..e606a13 100644 (file)
@@ -328,6 +328,7 @@ FolderItem *folder_get_default_queue        (void);
 FolderItem *folder_get_default_trash   (void);
 FolderItem *folder_get_default_processing (void);
 void folder_set_missing_folders                (void);
+void folder_unref_account_all          (PrefsAccount   *account);
 
 gchar *folder_get_path                 (Folder         *folder);
 gchar *folder_item_get_path            (FolderItem     *item);
index 59ebec0..d355e47 100644 (file)
@@ -1514,10 +1514,13 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
 
        if (folderview->mainwin->lock_count == 0) {
                new_folder = TRUE;
-               if (item->parent == NULL)
+               if (item->parent == NULL) {
                        update_tree = remove_tree = TRUE;
-               else
+                       if (folder->account)
+                               folder_property = TRUE;
+               } else
                        mark_all_read = search_folder = folder_property = TRUE;
+                       
                if (FOLDER_IS_LOCAL(folder) || FOLDER_TYPE(folder) == F_IMAP || FOLDER_TYPE(folder) == F_MBOX) {
                        if (item->parent == NULL)
                                update_tree = rescan_tree = TRUE;
@@ -2290,6 +2293,7 @@ static void folderview_rm_imap_server_cb(FolderView *folderview, guint action,
 {
        GtkCTree *ctree = GTK_CTREE(folderview->ctree);
        FolderItem *item;
+       PrefsAccount *account;
        gchar *name, *name_;
        gchar *message;
        AlertValue avalue;
@@ -2320,8 +2324,9 @@ static void folderview_rm_imap_server_cb(FolderView *folderview, guint action,
                folderview->opened = NULL;
        }
 
-       account_destroy(item->folder->account);
+       account = item->folder->account;
        folder_destroy(item->folder);
+       account_destroy(account);
        gtk_ctree_remove_node(ctree, folderview->selected);
        account_set_menu();
        main_window_reflect_prefs_all();
@@ -2460,6 +2465,7 @@ static void folderview_rm_news_server_cb(FolderView *folderview, guint action,
 {
        GtkCTree *ctree = GTK_CTREE(folderview->ctree);
        FolderItem *item;
+       PrefsAccount *account;
        gchar *name, *name_;
        gchar *message;
        AlertValue avalue;
@@ -2490,8 +2496,9 @@ static void folderview_rm_news_server_cb(FolderView *folderview, guint action,
                folderview->opened = NULL;
        }
 
-       account_destroy(item->folder->account);
-       folder_destroy(item->folder);
+       account = item->folder->account;
+       folder_destroy(item->folder);
+       account_destroy(account);
        gtk_ctree_remove_node(ctree, folderview->selected);
        account_set_menu();
        main_window_reflect_prefs_all();
@@ -2522,7 +2529,10 @@ static void folderview_property_cb(FolderView *folderview, guint action,
        /*
         * CLAWS: wait till Hiro has completed his stuff
         */
-       prefs_folder_item_open(item);
+       if (item->parent == NULL && item->folder->account)
+               account_open(item->folder->account);
+       else
+               prefs_folder_item_open(item);
 #endif 
 }
 
index acdf385..d36245b 100644 (file)
@@ -3501,14 +3501,7 @@ static void prefs_account_open_cb(MainWindow *mainwin, guint action,
        if (!cur_account) {
                new_account_cb(mainwin, 0, widget);
        } else {
-               gboolean prev_default = cur_account->is_default;
-
-               prefs_account_open(cur_account);
-               if (!prev_default && cur_account->is_default)
-                       account_set_as_default(cur_account);
-               account_save_config_all();
-               account_set_menu();
-               main_window_reflect_prefs_all();
+               account_open(cur_account);
        }
 }