sync with 0.7.5cvs19
authorPaul Mangan <paul@claws-mail.org>
Sat, 11 May 2002 08:10:09 +0000 (08:10 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 11 May 2002 08:10:09 +0000 (08:10 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/automaton.c
src/automaton.h
src/folderview.c
src/imap.c
src/inc.c
src/pop.c
src/procmime.c

index ea0bab5..0f4ce7e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2002-05-11
+
+       * src/imap.c: imap_scan_tree(): don't use namespace for prefix.
+       * src/prefs_folder_item.c: show also identifier path.
+         Made layout using table. Show uneditable entry using background
+         color of window.
+       * src/procmime.c: procmime_get_tmp_file_name(): generate safe
+         file name.
+
+2002-05-11
+
+       * src/automaton.[ch]: added UI callback to Automaton.
+       * src/inc.c
+         src/pop.c: use callback instead of calling inc_progress_update()
+         directly.
+         pop3_getrange_uidl_recv(): don't fall back to LAST when 'get all'
+         option is set.
+
+2002-05-10
+
+       * src/folderview.c: properly sort abbreviated newsgroups.
+
 2002-05-10
 
        * src/folderview.c
index 4af3f34..e646013 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-11 [paul]      0.7.5claws17
+
+       * sync with 0.7.5cvs19 (except src/prefs_folder_item.c)
+               see ChangeLog 2002-05-10 and 2002-05-11
+
 2002-05-10 [paul]      0.7.5claws16
 
        * sync with 0.7.5cvs16
index d32ddd4..7817990 100644 (file)
@@ -1,3 +1,27 @@
+2002-05-11
+
+       * src/imap.c: imap_scan_tree(): namespace ¤ò¥×¥ì¥Õ¥£¥¯¥¹¤Ë»ÈÍѤ·¤Ê¤¤
+         ¤è¤¦¤Ë¤·¤¿¡£
+       * src/prefs_folder_item.c: ¼±Ê̻ҥѥ¹¤âɽ¼¨¡£
+         table ¤ò»È¤Ã¤Æ¥ì¥¤¥¢¥¦¥È¡£ÊÔ½¸ÉԲĤʥ¨¥ó¥È¥ê¤ò¥¦¥£¥ó¥É¥¦¤ÎÇØ·Ê¿§
+         ¤Çɽ¼¨¡£
+       * src/procmime.c: procmime_get_tmp_file_name(): °ÂÁ´¤Ê¥Õ¥¡¥¤¥ë̾¤ò
+         À¸À®¡£
+
+2002-05-11
+
+       * src/automaton.[ch]: Automaton ¤Ë UI ¥³¡¼¥ë¥Ð¥Ã¥¯¤òÄɲá£
+       * src/inc.c
+         src/pop.c: inc_progress_update() ¤òľÀܸƤÖÂå¤ï¤ê¤Ë¥³¡¼¥ë¥Ð¥Ã¥¯¤ò
+         »ÈÍÑ¡£
+         pop3_getrange_uidl_recv(): ¡ÖÁ´¼õ¿®¡×¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë
+         ¤È¤­¤Ï LAST ¤Ë fallback ¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+
+2002-05-10
+
+       * src/folderview.c: ´Êάɽ¼¨¤µ¤ì¤¿¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤òÀµ¤·¤¯¥½¡¼¥È
+         ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2002-05-10
 
        * src/folderview.c
index d69f278..757b0d6 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws16
+EXTRA_VERSION=claws17
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index b36d90a..2ddb198 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -65,6 +65,8 @@ void automaton_input_cb(gpointer data, gint dummy_source,
        gdk_input_remove(atm->tag);
        atm->tag = 0;
 
+       if (atm->ui_func)
+               atm->ui_func(atm->data, atm->num);
        next = atm->state[atm->num].handler(sock, atm->data);
 
        if (atm->terminated)
index d8d3d8c..41910cd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 typedef struct _AtmState       AtmState;
 typedef struct _Automaton      Automaton;
 
-typedef gint   (*AtmHandler)   (SockInfo *source, gpointer data);
+typedef gint   (*AtmHandler)   (SockInfo       *source,
+                                gpointer        data);
+typedef void   (*AtmUIFunc)    (gpointer        data,
+                                gint            state);
 
 struct _AtmState
 {
        GdkInputCondition condition;
-       gint (*handler)(SockInfo *source, gpointer data);
+       gint (*handler) (SockInfo       *source,
+                        gpointer        data);
 };
 
 struct _Automaton
@@ -43,15 +47,22 @@ struct _Automaton
        guint timeout_tag;
        guint elapsed;
        gboolean terminated;
+
        gpointer data;
        AtmState *state;
-       gint (*terminate)(SockInfo *source, gpointer data);
+
+       gint (*terminate)       (SockInfo       *source,
+                                gpointer        data);
+
+       AtmUIFunc ui_func;
+
        SockInfo *help_sock;
 };
 
-Automaton *automaton_create(gint num);
-void automaton_destroy(Automaton *atm);
-void automaton_input_cb(gpointer data, gint dummy_source,
-                       GdkInputCondition condition);
+Automaton *automaton_create    (gint                    num);
+void automaton_destroy         (Automaton              *atm);
+void automaton_input_cb                (gpointer                data,
+                                gint                    dummy_source,
+                                GdkInputCondition       condition);
 
 #endif /* __AUTOMATON_H__ */
index 0e56415..124d317 100644 (file)
@@ -156,6 +156,9 @@ static GtkCTreeNode *folderview_find_by_name        (GtkCTree       *ctree,
                                                 GtkCTreeNode   *node,
                                                 const gchar    *name);
 
+static gint folderview_clist_compare   (GtkCList       *clist,
+                                        gconstpointer   ptr1,
+                                        gconstpointer   ptr2);
 static gint folderview_compare_name    (gconstpointer   a,
                                         gconstpointer   b);
 
@@ -387,6 +390,7 @@ FolderView *folderview_create(void)
        gtk_ctree_set_expander_style(GTK_CTREE(ctree),
                                     GTK_CTREE_EXPANDER_SQUARE);
        gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
+       gtk_clist_set_compare_func(GTK_CLIST(ctree), folderview_clist_compare);
 
        /* don't let title buttons take key focus */
        for (i = 0; i < N_FOLDER_COLS; i++)
@@ -2295,7 +2299,7 @@ static void folderview_new_news_group_cb(FolderView *folderview, guint action,
                gtk_ctree_node_set_row_data(ctree, node, newitem);
        }
 
-       gtk_ctree_sort_node(ctree, servernode);
+       folderview_sort_folders(folderview, servernode, folder);
        gtk_clist_thaw(GTK_CLIST(ctree));
 
        slist_free_strings(new_subscr);
@@ -2509,6 +2513,20 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                gtk_drag_finish(drag_context, FALSE, FALSE, time);
 }
 
+static gint folderview_clist_compare(GtkCList *clist,
+                                    gconstpointer ptr1, gconstpointer ptr2)
+{
+       FolderItem *item1 = ((GtkCListRow *)ptr1)->data;
+       FolderItem *item2 = ((GtkCListRow *)ptr2)->data;
+
+       if (!item1->name)
+               return (item2->name != NULL);
+       if (!item2->name)
+               return -1;
+
+       return g_strcasecmp(item1->name, item2->name);
+}
+
 static gint folderview_compare_name(gconstpointer a, gconstpointer b)
 {
        const FolderItem *item = a;
index 835e66c..de06eb8 100644 (file)
@@ -973,7 +973,6 @@ gint imap_scan_folder(Folder *folder, FolderItem *item)
 
 void imap_scan_tree(Folder *folder)
 {
-       IMAPFolder *imapfolder = IMAP_FOLDER(folder);
        FolderItem *item;
        IMAPSession *session;
        gchar *root_folder = NULL;
@@ -985,29 +984,15 @@ void imap_scan_tree(Folder *folder)
        if (!session) return;
 
        if (folder->account->imap_dir && *folder->account->imap_dir) {
-               gchar *imap_dir;
-               IMAPNameSpace *namespace = NULL;
-
-               Xstrdup_a(imap_dir, folder->account->imap_dir, return);
-               strtailchomp(imap_dir, '/');
-
-               if (imapfolder->ns_personal && imapfolder->ns_personal->data)
-                       namespace = (IMAPNameSpace *)imapfolder->ns_personal->data;
-               root_folder = g_strconcat
-                       (namespace && namespace->name ? namespace->name : "",
-                        imap_dir, NULL);
-               if (namespace && namespace->separator)
-                       subst_char(root_folder, namespace->separator, '/');
-       }
-
-       if (root_folder)
+               Xstrdup_a(root_folder, folder->account->imap_dir, return);
+               strtailchomp(root_folder, '/');
                debug_print("IMAP root directory: %s\n", root_folder);
+       }
 
        folder_tree_destroy(folder);
        item = folder_item_new(folder->name, root_folder);
        item->folder = folder;
        folder->node = g_node_new(item);
-       g_free(root_folder);
 
        imap_scan_tree_recursive(session, item);
 
index de6183b..67b1881 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -689,6 +689,7 @@ static IncState inc_pop3_session_do(IncSession *session)
        }
 
        atm->terminate = (AtmHandler)pop3_automaton_terminate;
+       atm->ui_func = (AtmUIFunc)inc_progress_update;
 
        atm->num = POP3_GREETING_RECV;
 
@@ -945,35 +946,27 @@ void inc_progress_update(Pop3State *state, Pop3Phase phase)
        case POP3_GREETING_RECV:
                break;
        case POP3_GETAUTH_USER_SEND:
-       case POP3_GETAUTH_USER_RECV:
        case POP3_GETAUTH_PASS_SEND:
-       case POP3_GETAUTH_PASS_RECV:
        case POP3_GETAUTH_APOP_SEND:
-       case POP3_GETAUTH_APOP_RECV:
                progress_dialog_set_label(dialog, _("Authenticating..."));
                break;
        case POP3_GETRANGE_STAT_SEND:
-       case POP3_GETRANGE_STAT_RECV:
                progress_dialog_set_label
                        (dialog, _("Getting the number of new messages (STAT)..."));
                break;
        case POP3_GETRANGE_LAST_SEND:
-       case POP3_GETRANGE_LAST_RECV:
                progress_dialog_set_label
                        (dialog, _("Getting the number of new messages (LAST)..."));
                break;
        case POP3_GETRANGE_UIDL_SEND:
-       case POP3_GETRANGE_UIDL_RECV:
                progress_dialog_set_label
                        (dialog, _("Getting the number of new messages (UIDL)..."));
                break;
        case POP3_GETSIZE_LIST_SEND:
-       case POP3_GETSIZE_LIST_RECV:
                progress_dialog_set_label
                        (dialog, _("Getting the size of messages (LIST)..."));
                break;
        case POP3_TOP_SEND:
-       case POP3_TOP_RECV:
                g_snprintf(buf, sizeof(buf),
                           _("Retrieving header (%d / %d)"),
                           state->cur_msg, state->count);
@@ -988,7 +981,6 @@ void inc_progress_update(Pop3State *state, Pop3Phase phase)
                         (gfloat)(state->count));
                break;
        case POP3_RETR_SEND:
-       case POP3_RETR_RECV:
                Xstrdup_a(total_size, to_human_readable(state->total_bytes), return);
                g_snprintf(buf, sizeof(buf),
                           _("Retrieving message (%d / %d) (%s / %s)"),
@@ -1005,12 +997,12 @@ void inc_progress_update(Pop3State *state, Pop3Phase phase)
                         (gfloat)(state->cur_total_bytes) /
                         (gfloat)(state->total_bytes));
                break;
+#if 0
        case POP3_DELETE_SEND:
-       case POP3_DELETE_RECV:
                progress_dialog_set_label(dialog, _("Deleting message"));
                break;
+#endif
        case POP3_LOGOUT_SEND:
-       case POP3_LOGOUT_RECV:
                progress_dialog_set_label(dialog, _("Quitting"));
                break;
        default:
index b2b5136..f04046e 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -89,8 +89,6 @@ gint pop3_getauth_user_send(SockInfo *sock, gpointer data)
 
        g_return_val_if_fail(state->user != NULL, -1);
 
-       inc_progress_update(state, POP3_GETAUTH_USER_SEND);
-
        pop3_gen_send(sock, "USER %s", state->user);
 
        return POP3_GETAUTH_USER_RECV;
@@ -150,8 +148,6 @@ gint pop3_getauth_apop_send(SockInfo *sock, gpointer data)
        g_return_val_if_fail(state->user != NULL, -1);
        g_return_val_if_fail(state->pass != NULL, -1);
 
-       inc_progress_update(state, POP3_GETAUTH_APOP_SEND);
-
        if ((start = strchr(state->greeting, '<')) == NULL) {
                log_warning(_("Required APOP timestamp not found "
                              "in greeting\n"));
@@ -196,10 +192,6 @@ gint pop3_getauth_apop_recv(SockInfo *sock, gpointer data)
 
 gint pop3_getrange_stat_send(SockInfo *sock, gpointer data)
 {
-       Pop3State *state = (Pop3State *)data;
-
-       inc_progress_update(state, POP3_GETRANGE_STAT_SEND);
-
        pop3_gen_send(sock, "STAT");
 
        return POP3_GETRANGE_STAT_RECV;
@@ -235,10 +227,6 @@ gint pop3_getrange_stat_recv(SockInfo *sock, gpointer data)
 
 gint pop3_getrange_last_send(SockInfo *sock, gpointer data)
 {
-       Pop3State *state = (Pop3State *)data;
-
-       inc_progress_update(state, POP3_GETRANGE_LAST_SEND);
-
        pop3_gen_send(sock, "LAST");
 
        return POP3_GETRANGE_LAST_RECV;
@@ -269,10 +257,6 @@ gint pop3_getrange_last_recv(SockInfo *sock, gpointer data)
 
 gint pop3_getrange_uidl_send(SockInfo *sock, gpointer data)
 {
-       Pop3State *state = (Pop3State *)data;
-
-       inc_progress_update(state, POP3_GETRANGE_UIDL_SEND);
-
        pop3_gen_send(sock, "UIDL");
 
        return POP3_GETRANGE_UIDL_RECV;
@@ -286,12 +270,18 @@ gint pop3_getrange_uidl_recv(SockInfo *sock, gpointer data)
        gchar buf[POPBUFSIZE];
        gchar id[IDLEN + 1];
 
-       if (pop3_ok(sock, NULL) != PS_SUCCESS) return POP3_GETRANGE_LAST_SEND;
-
        if (!state->uidl_table) new = TRUE;
        if (state->ac_prefs->getall)
                get_all = TRUE;
 
+       if (pop3_ok(sock, NULL) != PS_SUCCESS) {
+               /* UIDL is not supported */
+               if (!get_all)
+                       return POP3_GETRANGE_LAST_SEND;
+               else
+                       return POP3_GETSIZE_LIST_SEND;
+       }
+
        while (sock_gets(sock, buf, sizeof(buf)) >= 0) {
                gint num;
 
@@ -370,10 +360,6 @@ static gboolean should_delete(const char *uidl, gpointer data)
 
 gint pop3_getsize_list_send(SockInfo *sock, gpointer data)
 {
-       Pop3State *state = (Pop3State *)data;
-
-       inc_progress_update(state, POP3_GETSIZE_LIST_SEND);
-
        pop3_gen_send(sock, "LIST");
 
        return POP3_GETSIZE_LIST_RECV;
@@ -469,8 +455,6 @@ gint pop3_retr_send(SockInfo *sock, gpointer data)
 {
        Pop3State *state = (Pop3State *)data;
 
-       inc_progress_update(state, POP3_RETR_SEND);
-
        pop3_gen_send(sock, "RETR %d", state->cur_msg);
 
        return POP3_RETR_RECV;
@@ -522,8 +506,6 @@ gint pop3_delete_send(SockInfo *sock, gpointer data)
 {
        Pop3State *state = (Pop3State *)data;
 
-       /* inc_progress_update(state, POP3_DELETE_SEND); */
-
        pop3_gen_send(sock, "DELE %d", state->cur_msg);
 
        return POP3_DELETE_RECV;
@@ -571,8 +553,6 @@ gint pop3_logout_send(SockInfo *sock, gpointer data)
                g_strfreev(parts);      
        }
        
-       inc_progress_update(state, POP3_LOGOUT_SEND);
-
        pop3_gen_send(sock, "QUIT");
 
        return POP3_LOGOUT_RECV;
index 9241d87..1866303 100644 (file)
@@ -1037,6 +1037,8 @@ gchar *procmime_get_tmp_file_name(MimeInfo *mimeinfo)
                        : mimeinfo->name ? mimeinfo->name : "mimetmp";
                base = g_basename(base);
                if (*base == '\0') base = "mimetmp";
+               Xstrdup_a(base, base, return NULL);
+               subst_for_filename(base);
        }
 
        filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,