remove selective download
authorOliver Haertel <o.h.a@gmx.net>
Wed, 26 Mar 2003 22:31:30 +0000 (22:31 +0000)
committerOliver Haertel <o.h.a@gmx.net>
Wed, 26 Mar 2003 22:31:30 +0000 (22:31 +0000)
ChangeLog.claws
configure.ac
src/matcher_parser_parse.y
src/pop.c
src/prefs_account.c
src/prefs_account.h
src/prefs_filtering.c

index 384b974..78869ad 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-26 [oliver]    0.8.11claws53
+       * src/matcher.[ch]
+       * src/matcher_parser_parse.y 
+       * src/pop.c 
+       * src/prefs_account.[ch]
+       * src/prefs_filtering.c
+               remove selective donwload
+
 2003-03-26 [oliver]    0.8.11claws52
 
        * src/inc.[ch] 
index 6834adf..0b286f6 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws52
+EXTRA_VERSION=claws53
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 9e90b4a..915498c 100644 (file)
@@ -216,7 +216,7 @@ int matcher_parserwrap(void)
 %token MATCHER_MARK_AS_READ  MATCHER_MARK_AS_UNREAD  MATCHER_FORWARD
 %token MATCHER_FORWARD_AS_ATTACHMENT  MATCHER_EOL  MATCHER_STRING  
 %token MATCHER_OR MATCHER_AND  
-%token MATCHER_COLOR MATCHER_SCORE_EQUAL MATCHER_REDIRECT MATCHER_DELETE_ON_SERVER
+%token MATCHER_COLOR MATCHER_SCORE_EQUAL MATCHER_REDIRECT 
 %token MATCHER_SIZE_GREATER MATCHER_SIZE_SMALLER MATCHER_SIZE_EQUAL
 %token MATCHER_LOCKED MATCHER_NOT_LOCKED
 %token MATCHER_COLORLABEL MATCHER_NOT_COLORLABEL
@@ -943,12 +943,6 @@ MATCHER_EXECUTE MATCHER_STRING
        color = atoi($2);
        action = filteringaction_new(action_type, 0, NULL, color);
 }
-| MATCHER_DELETE_ON_SERVER
-{
-       gint action_type = 0;
-       action_type = MATCHACTION_DELETE_ON_SERVER;
-       action = filteringaction_new(action_type, 0, NULL, 0);
-}
 | MATCHER_CHANGE_SCORE MATCHER_STRING
 {
        gint action_type = MATCHACTION_CHANGE_SCORE;
index 81e0167..2b56342 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -37,9 +37,7 @@
 #include "utils.h"
 #include "inc.h"
 #include "recv.h"
-/* disable sd
-#include "selective_download.h"
-*/
+
 #include "log.h"
 
 static gint pop3_greeting_recv         (Pop3Session *session,
@@ -89,11 +87,7 @@ static gint pop3_session_recv_msg            (Session        *session,
 static gint pop3_session_recv_data_finished    (Session        *session,
                                                 guchar         *data,
                                                 guint           len);
-/* disable sd
-static gboolean pop3_sd_get_next (Pop3State *state);
-static void pop3_sd_new_header(Pop3State *state);
-gboolean pop3_sd_state(Pop3State *state, gint cur_state, guint *next_state);
-*/
+
 static gint pop3_greeting_recv(Pop3Session *session, const gchar *msg)
 {
        session->state = POP3_GREETING;
@@ -265,10 +259,6 @@ static gint pop3_getrange_uidl_recv(Pop3Session *session, const gchar *msg)
                session->new_msg_exist = TRUE;
        }
 
-/* disable sd
-       if (pop3_sd_state(state, POP3_GETRANGE_UIDL_RECV, &next_state))
-               return next_state;
-*/
        return PS_CONTINUE;
 }
 
@@ -297,59 +287,9 @@ static gint pop3_getsize_list_recv(Pop3Session *session, const gchar *msg)
        if (num > 0 && num < session->cur_msg)
                session->cur_total_bytes += size;
 
-/* disable sd
-       if (pop3_sd_state(state, POP3_GETSIZE_LIST_RECV, &next_state))
-               return next_state;
-*/
        return PS_CONTINUE;
 }
-/* disable sd 
-gint pop3_top_send(SockInfo *sock, gpointer data)
-{
-       Pop3State *state = (Pop3State *)data;
-
-       inc_progress_update(state, POP3_TOP_SEND); 
-
-       pop3_gen_send(sock, "TOP %i 0", state->cur_msg );
-
-       return POP3_TOP_RECV;
-}
 
-gint pop3_top_recv(SockInfo *sock, gpointer data)
-{
-       Pop3State *state = (Pop3State *)data;
-       gchar *filename, *path;
-       gint next_state;
-       gint write_val;
-       if (pop3_ok(sock, NULL) != PS_SUCCESS) 
-               return POP3_LOGOUT_SEND;
-
-       path = g_strconcat(get_header_cache_dir(), G_DIR_SEPARATOR_S, NULL);
-
-       if ( !is_dir_exist(path) )
-               make_dir_hier(path);
-       
-       filename = g_strdup_printf("%s%i", path, state->cur_msg);
-                                  
-       if ( (write_val = recv_write_to_file(sock, filename)) < 0) {
-               state->error_val = (write_val == -1 ? PS_IOERR : PS_SOCKET);
-               g_free(path);
-               g_free(filename);
-               return -1;
-       }
-       
-       g_free(path);
-       g_free(filename);
-       
-       pop3_sd_state(state, POP3_TOP_RECV, &next_state);
-       
-       if (state->cur_msg < state->count) {
-               state->cur_msg++;
-               return POP3_TOP_SEND;
-       } else
-               return POP3_LOGOUT_SEND;
-}
-*/
 static gint pop3_retr_send(Pop3Session *session)
 {
        session->state = POP3_RETR;
@@ -377,10 +317,7 @@ static gint pop3_retr_recv(Pop3Session *session, const gchar *data, guint len)
                session->error_val = PS_ERROR;
                return -1;
        }
-/* disable sd
-       if (pop3_sd_state(state, POP3_RETR_RECV, &next_state))
-               return next_state;
-*/     
+
        session->cur_total_bytes += session->msg[session->cur_msg].size;
        session->cur_total_recv_bytes += session->msg[session->cur_msg].size;
        session->cur_total_num++;
@@ -428,156 +365,7 @@ static void pop3_gen_send(Pop3Session *session, const gchar *format, ...)
 
        session_send_msg(SESSION(session), SESSION_MSG_NORMAL, buf);
 }
-/* disable sd
-static void pop3_sd_new_header(Pop3State *state)
-{
-       HeaderItems *new_msg;
-       if (state->cur_msg <= state->count) {
-               new_msg = g_new0(HeaderItems, 1); 
-               
-               new_msg->index              = state->cur_msg;
-               new_msg->state              = SD_UNCHECKED;
-               new_msg->size               = state->msg[state->cur_msg].size; 
-               new_msg->received           = state->msg[state->cur_msg].received;
-               new_msg->del_by_old_session = FALSE;
-               
-               state->ac_prefs->msg_list = g_slist_append(state->ac_prefs->msg_list, 
-                                                          new_msg);
-               debug_print("received ?: msg %i, received: %i\n",new_msg->index, new_msg->received); 
-       }
-}
-
-gboolean pop3_sd_state(Pop3State *state, gint cur_state, guint *next_state) 
-{
-       gint session = state->ac_prefs->session;
-       guint goto_state = -1;
-
-       switch (cur_state) { 
-       case POP3_GETRANGE_UIDL_RECV:
-               switch (session) {
-               case STYPE_POP_BEFORE_SMTP:
-                       goto_state = POP3_LOGOUT_SEND;
-                       break;
-               case STYPE_DOWNLOAD:
-               case STYPE_DELETE:
-               case STYPE_PREVIEW_ALL:
-                       goto_state = POP3_GETSIZE_LIST_SEND;
-               default:
-                       break;
-               }
-               break;
-       case POP3_GETSIZE_LIST_RECV:
-               switch (session) {
-               case STYPE_PREVIEW_ALL:
-                       state->cur_msg = 1;
-               case STYPE_PREVIEW_NEW:
-                       goto_state = POP3_TOP_SEND;
-                       break;
-               case STYPE_DELETE:
-                       if (pop3_sd_get_next(state))
-                               goto_state = POP3_DELETE_SEND;          
-                       else
-                               goto_state = POP3_LOGOUT_SEND;
-                       break;
-               case STYPE_DOWNLOAD:
-                       if (pop3_sd_get_next(state))
-                               goto_state = POP3_RETR_SEND;
-                       else
-                               goto_state = POP3_LOGOUT_SEND;
-               default:
-                       break;
-               }
-               break;
-       case POP3_TOP_RECV: 
-               switch (session) { 
-               case STYPE_PREVIEW_ALL:
-               case STYPE_PREVIEW_NEW:
-                       pop3_sd_new_header(state);
-               default:
-                       break;
-               }
-               break;
-       case POP3_RETR_RECV:
-               switch (session) {
-               case STYPE_DOWNLOAD:
-                       if (state->ac_prefs->sd_rmmail_on_download) 
-                               goto_state = POP3_DELETE_SEND;
-                       else {
-                               if (pop3_sd_get_next(state)) 
-                                       goto_state = POP3_RETR_SEND;
-                               else
-                                       goto_state = POP3_LOGOUT_SEND;
-                       }
-               default:        
-                       break;
-               }
-               break;
-       case POP3_DELETE_RECV:
-               switch (session) {
-               case STYPE_DELETE:
-                       if (pop3_sd_get_next(state)) 
-                               goto_state = POP3_DELETE_SEND;
-                       else
-                               goto_state =  POP3_LOGOUT_SEND;
-                       break;
-               case STYPE_DOWNLOAD:
-                       if (pop3_sd_get_next(state)) 
-                               goto_state = POP3_RETR_SEND;
-                       else
-                               goto_state = POP3_LOGOUT_SEND;
-               default:
-                       break;
-               }
-       default:
-               break;
-               
-       }                 
-
-       *next_state = goto_state;
-       if (goto_state != -1)
-               return TRUE;
-       else 
-               return FALSE;
-}
 
-gboolean pop3_sd_get_next(Pop3State *state)
-{
-       GSList *cur;
-       gint deleted_msgs = 0;
-       
-       switch (state->ac_prefs->session) {
-       case STYPE_DOWNLOAD:
-       case STYPE_DELETE:      
-               for (cur = state->ac_prefs->msg_list; cur != NULL; cur = cur->next) {
-                       HeaderItems *items = (HeaderItems*)cur->data;
-
-                       if (items->del_by_old_session)
-                               deleted_msgs++;
-
-                       switch (items->state) {
-                       case SD_REMOVE:
-                               items->state = SD_REMOVED;
-                               break;
-                       case SD_DOWNLOAD:
-                               items->state = SD_DOWNLOADED;
-                               break;
-                       case SD_CHECKED:
-                               state->cur_msg = items->index - deleted_msgs;
-                               if (state->ac_prefs->session == STYPE_DELETE)
-                                       items->state = SD_REMOVE;
-                               else
-                                       items->state = SD_DOWNLOAD;
-                               return TRUE;
-                       default:
-                               break;
-                       }
-               }
-               return FALSE;
-       default:
-               return FALSE;
-       }
-}
-*/
 Session *pop3_session_new(PrefsAccount *account)
 {
        Pop3Session *session;
index 6a10829..dba5f8c 100644 (file)
@@ -89,8 +89,6 @@ static struct Receive {
        GtkWidget *rmmail_chkbtn;
        GtkWidget *leave_time_entry;
        GtkWidget *getall_chkbtn;
-       GtkWidget *sd_filter_on_recv_chkbtn;
-       GtkWidget *sd_rmmail_chkbtn;
        GtkWidget *size_limit_chkbtn;
        GtkWidget *size_limit_entry;
        GtkWidget *filter_on_recv_chkbtn;
@@ -304,14 +302,6 @@ static PrefParam param[] = {
         &receive.filter_on_recv_chkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
-       /* selective download */        
-       {"sd_filter_on_receive", "TRUE", &tmp_ac_prefs.sd_filter_on_recv, P_BOOL,
-        &receive.sd_filter_on_recv_chkbtn,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"sd_remove_mail_on_download", "TRUE", &tmp_ac_prefs.sd_rmmail_on_download, P_BOOL,
-        &receive.sd_rmmail_chkbtn,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-
        {"receive_at_get_all", "TRUE", &tmp_ac_prefs.recv_at_getall, P_BOOL,
         &receive.recvatgetall_chkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -1109,8 +1099,6 @@ static void prefs_account_receive_create(void)
        GtkWidget *size_limit_entry;
        GtkWidget *label;
        GtkWidget *filter_on_recv_chkbtn;
-       GtkWidget *sd_filter_on_recv_chkbtn;
-       GtkWidget *sd_rmmail_chkbtn;
        GtkWidget *vbox3;
        GtkWidget *inbox_label;
        GtkWidget *inbox_entry;
@@ -1181,10 +1169,6 @@ static void prefs_account_receive_create(void)
 
        PACK_CHECK_BUTTON (vbox2, getall_chkbtn,
                           _("Download all messages on server"));
-       PACK_CHECK_BUTTON (vbox2, sd_filter_on_recv_chkbtn,
-                          _("Use filtering rules with Selective Download"));
-       PACK_CHECK_BUTTON (vbox2, sd_rmmail_chkbtn,
-                          _("Remove mail after downloading with Selective Download"));
 
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
@@ -1276,8 +1260,6 @@ static void prefs_account_receive_create(void)
        receive.size_limit_chkbtn        = size_limit_chkbtn;
        receive.size_limit_entry         = size_limit_entry;
        receive.filter_on_recv_chkbtn    = filter_on_recv_chkbtn;
-       receive.sd_filter_on_recv_chkbtn = sd_filter_on_recv_chkbtn;
-       receive.sd_rmmail_chkbtn         = sd_rmmail_chkbtn;
        receive.inbox_label              = inbox_label;
        receive.inbox_entry              = inbox_entry;
        receive.inbox_btn                = inbox_btn;
index c5eae9a..379e137 100644 (file)
@@ -53,14 +53,6 @@ typedef enum {
 typedef enum {
        /* login and retrieve messages, as before */
        STYPE_NORMAL,
-       /* send TOP to server and retrieve all available Headers */
-       STYPE_PREVIEW_ALL,
-       /* send TOP to server and retrieve new Headers */
-       STYPE_PREVIEW_NEW,
-       /* delete selected Headers on Server */
-       STYPE_DELETE, 
-       /* download + remove Mail from Server */
-       STYPE_DOWNLOAD,
        /* just login (pop before smtp) */
        STYPE_POP_BEFORE_SMTP,
 } Pop3SessionType;
index 8e15987..3dc6683 100644 (file)
@@ -134,7 +134,6 @@ enum {
        ACTION_REDIRECT = 9,
        ACTION_EXECUTE = 10,
        ACTION_COLOR = 11,
-       ACTION_DELETE_ON_SERVER = 12,
 };
 
 static gint get_sel_from_list(GtkList * list)
@@ -215,8 +214,6 @@ static gint prefs_filtering_get_matching_from_action(gint action_id)
                return MATCHACTION_EXECUTE;
        case ACTION_COLOR:
                return MATCHACTION_COLOR;
-       case ACTION_DELETE_ON_SERVER:
-               return MATCHACTION_DELETE_ON_SERVER;
        default:
                return -1;
        }
@@ -235,7 +232,6 @@ static gchar * action_text [] = {
        N_("Redirect"), 
        N_("Execute"),
        N_("Color"),
-       N_("Delete on Server")
 };
 
 void prefs_filtering_open(FolderItem * item,
@@ -991,9 +987,6 @@ static FilteringProp * prefs_filtering_dialog_to_filtering(gboolean alert)
                        gtk_option_menu_get_menu(GTK_OPTION_MENU(filtering.color_optmenu)));
                destination = NULL;     
                break;
-       case ACTION_DELETE_ON_SERVER:
-               destination = NULL;
-               break;
        default:
                destination = NULL;
                break;
@@ -1184,10 +1177,6 @@ static void prefs_filtering_select_set(FilteringProp * prop)
                                     ACTION_COLOR);
                gtk_option_menu_set_history(GTK_OPTION_MENU(filtering.color_optmenu), action->labelcolor);     
                break;
-       case MATCHACTION_DELETE_ON_SERVER:
-               gtk_list_select_item(GTK_LIST(filtering.action_list),
-                                    ACTION_DELETE_ON_SERVER);
-               break;
        }
 
        g_free(matcher_str);
@@ -1438,22 +1427,6 @@ static void prefs_filtering_action_select(GtkList *list,
                gtk_widget_show(filtering.color_optmenu);
                gtk_widget_show(filtering.color_label);
                break;
-       case ACTION_DELETE_ON_SERVER:
-               gtk_widget_show(filtering.account_label);
-               gtk_widget_set_sensitive(filtering.account_label, FALSE);
-               gtk_widget_set_sensitive(filtering.account_combo, FALSE);
-               gtk_widget_show(filtering.dest_entry);
-               gtk_widget_set_sensitive(filtering.dest_entry, FALSE);
-               gtk_widget_show(filtering.dest_btn);
-               gtk_widget_set_sensitive(filtering.dest_btn, FALSE);
-               gtk_widget_show(filtering.dest_label);
-               gtk_widget_set_sensitive(filtering.dest_label, FALSE);
-               gtk_widget_hide(filtering.exec_label);
-               gtk_widget_show(filtering.exec_btn);
-               gtk_widget_hide(filtering.exec_btn);
-               gtk_widget_hide(filtering.color_optmenu);
-               gtk_widget_hide(filtering.color_label);
-               break;
        }
 }