From: Sergio Villar Senin Date: Wed, 19 Aug 2009 17:17:18 +0000 (+0200) Subject: Fixes NB#133352, do not ask the users if they want to download more emails than the... X-Git-Tag: 3.0.17-rc37~1 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=271699adf62b6841495684d3f106108318211b62 Fixes NB#133352, do not ask the users if they want to download more emails than the current limit --- diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 95cd33f..3b12158 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -136,7 +136,6 @@ typedef struct gint pending_calls; gboolean poke_all; TnyFolderObserver *inbox_observer; - RetrieveAllCallback retrieve_all_cb; gboolean interactive; gboolean msg_readed; } UpdateAccountInfo; @@ -1640,7 +1639,7 @@ inbox_refreshed_cb (TnyFolder *inbox, ModestAccountMgr *mgr; ModestAccountRetrieveType retrieve_type; TnyList *new_headers = NULL; - gboolean headers_only, ignore_limit; + gboolean headers_only; time_t time_to_store; info = (UpdateAccountInfo *) user_data; @@ -1729,20 +1728,6 @@ inbox_refreshed_cb (TnyFolder *inbox, /* Order by date */ g_ptr_array_sort (new_headers_array, (GCompareFunc) compare_headers_by_date); - /* Ask the users if they want to retrieve all the messages - even though the limit was exceeded */ - ignore_limit = FALSE; - if (new_headers_array->len > retrieve_limit) { - /* Ask the user if a callback has been specified and - if the mail operation has a source (this means that - was invoked by the user and not automatically by a - D-Bus method) */ - if (info->retrieve_all_cb && info->interactive) - ignore_limit = info->retrieve_all_cb (priv->source, - new_headers_array->len, - retrieve_limit); - } - /* Copy the headers to a list and free the array */ new_headers = tny_simple_list_new (); for (i=0; i < new_headers_array->len; i++) { @@ -1760,10 +1745,7 @@ inbox_refreshed_cb (TnyFolder *inbox, GetMsgInfo *msg_info; priv->done = 0; - if (ignore_limit) - priv->total = tny_list_get_length (new_headers); - else - priv->total = MIN (tny_list_get_length (new_headers), retrieve_limit); + priv->total = MIN (tny_list_get_length (new_headers), retrieve_limit); iter = tny_list_create_iterator (new_headers); @@ -1956,7 +1938,6 @@ modest_mail_operation_update_account (ModestMailOperation *self, const gchar *account_name, gboolean poke_all, gboolean interactive, - RetrieveAllCallback retrieve_all_cb, UpdateAccountCallback callback, gpointer user_data) { @@ -2013,7 +1994,6 @@ modest_mail_operation_update_account (ModestMailOperation *self, info->account_name = g_strdup (account_name); info->callback = callback; info->user_data = user_data; - info->retrieve_all_cb = retrieve_all_cb; /* Set account busy */ modest_account_mgr_set_account_busy (modest_runtime_get_account_mgr (), account_name, TRUE); diff --git a/src/modest-mail-operation.h b/src/modest-mail-operation.h index b271c92..8bc9bbf 100644 --- a/src/modest-mail-operation.h +++ b/src/modest-mail-operation.h @@ -456,7 +456,6 @@ void modest_mail_operation_update_account (ModestMailOperation *self, const gchar *account_name, gboolean poke_all, gboolean interactive, - RetrieveAllCallback retrieve_all_cb, UpdateAccountCallback callback, gpointer user_data); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index e1c8b21..f43ffbf 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -2212,29 +2212,6 @@ new_messages_arrived (ModestMailOperation *self, } -gboolean -retrieve_all_messages_cb (GObject *source, - guint num_msgs, - guint retrieve_limit) -{ - GtkWindow *window; - gchar *msg; - gint response; - - window = GTK_WINDOW (source); - msg = g_strdup_printf (_("mail_nc_msg_count_limit_exceeded"), - num_msgs, retrieve_limit); - - /* Ask the user if they want to retrieve all the messages */ - response = - modest_platform_run_confirmation_dialog_with_buttons (window, msg, - _("mcen_bd_get_all"), - _("mcen_bd_newest_only")); - /* Free and return */ - g_free (msg); - return (response == GTK_RESPONSE_ACCEPT) ? TRUE : FALSE; -} - typedef struct { TnyAccount *account; ModestWindow *win; @@ -2280,7 +2257,6 @@ do_send_receive_performer (gboolean canceled, /* Send & receive. */ modest_mail_operation_update_account (info->mail_op, info->account_name, info->poke_status, info->interactive, - (info->win) ? retrieve_all_messages_cb : NULL, new_messages_arrived, info->win); clean: