sync with sylpheed 0.5.0pre5
authorPaul Mangan <paul@claws-mail.org>
Fri, 6 Jul 2001 08:05:08 +0000 (08:05 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 6 Jul 2001 08:05:08 +0000 (08:05 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/folderview.c
src/imap.c

index 7510b83..694e672 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-07-06
+
+       * src/imap.c: imap_remove_folder(): select INBOX with EXAMINE before
+         DELETE.
+         imap_cmd_do_select(): new. It toggles between SELECT and EXAMINE
+         according to the argument.
+         imap_cmd_select(): use imap_cmd_do_select().
+         imap_cmd_examine(): new.
+       * src/folderview.c: folderview_rm_imap_folder_cb(): select current
+         folder again when removing failed.
+
 2001-07-05
 
        * version 0.5.0pre4
index 171b1ee..4a75ded 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-06 [paul]
+
+       0.5.0claws5
+
+       sync with sylpheed 0.5.0pre5
+
 2001-07-05 [paul]
 
        sync with sylpheed 0.5.0pre4 release
index 9c88c9d..230a169 100644 (file)
@@ -1,3 +1,14 @@
+2001-07-06
+
+       * src/imap.c: imap_remove_folder(): DELETE ¤ÎÁ°¤Ë EXAMINE ¤Ç INBOX
+         ¤òÁªÂò¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         imap_cmd_do_select(): ¿·µ¬¡£°ú¿ô¤Ë±þ¤¸¤Æ SELECT ¤È EXAMINE ¤ò
+         ÀÚ¤êÂؤ¨¤ë¡£
+         imap_cmd_select(): imap_cmd_do_select() ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         imap_cmd_examine(): ¿·µ¬¡£
+       * src/folderview.c: folderview_rm_imap_folder_cb(): ºï½ü¤Ë¼ºÇÔ¤·¤¿¤é
+         ¸½ºß¤Î¥Õ¥©¥ë¥À¤òºÆÅÙÁªÂò¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2001-07-05
 
        * version 0.5.0pre4
index 0ab89e9..e2982ff 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=5
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws4
+EXTRA_VERSION=claws5
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index b76c60f..d1b738c 100644 (file)
@@ -356,7 +356,6 @@ FolderView *folderview_create(void)
        gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
                           GTK_SIGNAL_FUNC(folderview_selected), folderview);
 
-
        gtk_signal_connect_after(GTK_OBJECT(ctree), "tree_expand",
                                 GTK_SIGNAL_FUNC(folderview_tree_expanded),
                                 folderview);
@@ -830,12 +829,10 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                                name = " (News)"; break;
                        default:
                                name = "";
-                               break;
                        }
                        name = g_strconcat(item->name, name, NULL);
                } else
                        name = g_strdup(item->name);
-               break;                  
        }
 
        if (!GTK_CTREE_ROW(node)->expanded &&
@@ -1300,7 +1297,6 @@ static void folderview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                BREAK_ON_MODIFIER_KEY();
                summary_pass_key_press_event(folderview->summaryview, event);
        default:
-               break;
        }
 }
 
@@ -1398,7 +1394,6 @@ static void folderview_col_resized(GtkCList *clist, gint column, gint width,
                prefs_common.folder_col_total = width;
                break;
        default:
-               break;
        }
 }
 
@@ -1834,6 +1829,10 @@ static void folderview_rm_imap_folder_cb(FolderView *folderview, guint action,
        if (item->folder->remove_folder(item->folder, item) < 0) {
                alertpanel_error(_("Can't remove the folder `%s'."),
                                 item->path);
+               if (folderview->opened == folderview->selected)
+                       summary_show(folderview->summaryview,
+                                    folderview->summaryview->folder_item,
+                                    FALSE);
                return;
        }
 
@@ -2051,7 +2050,6 @@ static gboolean folderview_drag_motion_cb(GtkWidget      *widget,
                                    acceptable = TRUE;
                                break;
                        default:
-                               break;
                        }
                }
        }
index 0518811..7e4f31c 100644 (file)
@@ -143,12 +143,25 @@ static gint imap_cmd_list (SockInfo       *sock,
                                 const gchar    *ref,
                                 const gchar    *mailbox,
                                 GPtrArray      *argbuf);
+static gint imap_cmd_do_select (SockInfo       *sock,
+                                const gchar    *folder,
+                                gboolean        examine,
+                                gint           *exists,
+                                gint           *recent,
+                                gint           *unseen,
+                                guint32        *uid_validity);
 static gint imap_cmd_select    (SockInfo       *sock,
                                 const gchar    *folder,
                                 gint           *exists,
                                 gint           *recent,
                                 gint           *unseen,
                                 guint32        *uid_validity);
+static gint imap_cmd_examine   (SockInfo       *sock,
+                                const gchar    *folder,
+                                gint           *exists,
+                                gint           *recent,
+                                gint           *unseen,
+                                guint32        *uid_validity);
 static gint imap_cmd_create    (SockInfo       *sock,
                                 const gchar    *folder);
 static gint imap_cmd_delete    (SockInfo       *sock,
@@ -1070,6 +1083,8 @@ gint imap_remove_folder(Folder *folder, FolderItem *item)
        gint ok;
        IMAPSession *session;
        gchar *path;
+       gint exists, recent, unseen;
+       guint32 uid_validity;
 
        g_return_val_if_fail(folder != NULL, -1);
        g_return_val_if_fail(item != NULL, -1);
@@ -1079,6 +1094,15 @@ gint imap_remove_folder(Folder *folder, FolderItem *item)
        if (!session) return -1;
 
        path = imap_get_real_path(IMAP_FOLDER(folder), item->path);
+
+       ok = imap_cmd_examine(SESSION(session)->sock, "INBOX",
+                             &exists, &recent, &unseen, &uid_validity);
+       statusbar_pop_all();
+       if (ok != IMAP_SUCCESS) {
+               g_free(path);
+               return -1;
+       }
+
        ok = imap_cmd_delete(SESSION(session)->sock, path);
        statusbar_pop_all();
        if (ok != IMAP_SUCCESS) {
@@ -1874,21 +1898,28 @@ static gint imap_cmd_list(SockInfo *sock, const gchar *ref,
 
 #define THROW goto catch
 
-static gint imap_cmd_select(SockInfo *sock, const gchar *folder,
-                           gint *exists, gint *recent, gint *unseen,
-                           guint32 *uid_validity)
+static gint imap_cmd_do_select(SockInfo *sock, const gchar *folder,
+                              gboolean examine,
+                              gint *exists, gint *recent, gint *unseen,
+                              guint32 *uid_validity)
 {
        gint ok;
        gchar *resp_str;
        GPtrArray *argbuf;
+       gchar *select_cmd;
 
        *exists = *recent = *unseen = *uid_validity = 0;
        argbuf = g_ptr_array_new();
 
+       if (examine)
+               select_cmd = "EXAMINE";
+       else
+               select_cmd = "SELECT";
+
        if (strchr(folder, ' ') != NULL)
-               imap_cmd_gen_send(sock, "SELECT \"%s\"", folder);
+               imap_cmd_gen_send(sock, "%s \"%s\"", select_cmd, folder);
        else
-               imap_cmd_gen_send(sock, "SELECT %s", folder);
+               imap_cmd_gen_send(sock, "%s %s", select_cmd, folder);
 
        if ((ok = imap_cmd_ok(sock, argbuf)) != IMAP_SUCCESS) THROW;
 
@@ -1932,6 +1963,22 @@ catch:
        return ok;
 }
 
+static gint imap_cmd_select(SockInfo *sock, const gchar *folder,
+                           gint *exists, gint *recent, gint *unseen,
+                           guint32 *uid_validity)
+{
+       return imap_cmd_do_select(sock, folder, FALSE,
+                                 exists, recent, unseen, uid_validity);
+}
+
+static gint imap_cmd_examine(SockInfo *sock, const gchar *folder,
+                            gint *exists, gint *recent, gint *unseen,
+                            guint32 *uid_validity)
+{
+       return imap_cmd_do_select(sock, folder, TRUE,
+                                 exists, recent, unseen, uid_validity);
+}
+
 #undef THROW
 
 static gint imap_cmd_create(SockInfo *sock, const gchar *folder)