Changeset 3727

Show
Ignore:
Timestamp:
07/23/08 13:45:54
Author:
svillar
Message:
  • Ported bug fix from trunk
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/modest/diablo-pe2/ChangeLog

    r3724 r3727  
     12008-07-23  Sergio Villar Senin  <svillar@igalia.com> 
     2 
     3        * libtinymail-camel/tny-camel-account.c 
     4        (_tny_camel_account_start_camel_operation_n): added a missing 
     5        camel_operation_register that was preventing progress info to be 
     6        threw up and cancelations as well. 
     7 
     8        * libtinymail-camel/tny-camel-folder.c: added progress information 
     9        to get_headers_async function. 
     10 
    1112008-07-21  Jose Dapena Paz  <jdapena@igalia.com> 
    212 
  • releases/modest/diablo-pe2/libtinymail-camel/tny-camel-account.c

    r3710 r3727  
    782782        priv->cancel = camel_operation_new (func, user_data); 
    783783 
     784        camel_operation_register (priv->cancel); 
    784785        camel_operation_start (priv->cancel, (char*)what); 
    785786 
  • releases/modest/diablo-pe2/libtinymail-camel/tny-camel-folder.c

    r3710 r3727  
    21502150        gboolean refresh; 
    21512151        TnyGetHeadersCallback callback; 
     2152        TnyStatusCallback status_callback; 
    21522153        gpointer user_data; 
    21532154        TnySessionCamel *session; 
    21542155        gboolean cancelled; 
     2156        TnyIdleStopper *stopper; 
    21552157 
    21562158} GetHeadersInfo; 
     
    21702172        if (info->err) 
    21712173                g_error_free (info->err); 
     2174 
     2175        tny_idle_stopper_destroy (info->stopper); 
     2176        info->stopper = NULL; 
    21722177 
    21732178        /**/ 
     
    21872192                tny_lockable_unlock (info->session->priv->ui_lock); 
    21882193        } 
     2194        tny_idle_stopper_stop (info->stopper); 
     2195 
    21892196        return FALSE; 
    21902197} 
     2198 
     2199static void 
     2200tny_camel_folder_get_headers_async_status (struct _CamelOperation *op, const char *what, int sofar, int oftotal, void *thr_user_data) 
     2201{ 
     2202        GetHeadersInfo *oinfo = thr_user_data; 
     2203        TnyProgressInfo *info = NULL; 
     2204 
     2205        info = tny_progress_info_new (G_OBJECT (oinfo->self), oinfo->status_callback,  
     2206                                      TNY_FOLDER_STATUS, TNY_FOLDER_STATUS_CODE_GET_MSG, what, sofar,  
     2207                                      oftotal, oinfo->stopper, oinfo->session->priv->ui_lock, oinfo->user_data); 
     2208         
     2209        g_idle_add_full (TNY_PRIORITY_LOWER_THAN_GTK_REDRAWS,  
     2210                         tny_progress_info_idle_func, info,  
     2211                         tny_progress_info_destroy); 
     2212         
     2213        return; 
     2214} 
     2215 
    21912216 
    21922217static gpointer  
     
    21942219{ 
    21952220        GetHeadersInfo *info = (GetHeadersInfo*) thr_user_data; 
     2221        TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->self); 
     2222 
    21962223        info->err = NULL; 
     2224        info->cancelled = FALSE; 
     2225 
     2226        g_static_rec_mutex_lock (priv->folder_lock); 
     2227 
     2228        _tny_camel_account_start_camel_operation (TNY_CAMEL_ACCOUNT (priv->account), 
     2229                                                  tny_camel_folder_get_headers_async_status,  
     2230                                                  info, "Getting headers"); 
     2231 
    21972232        tny_folder_get_headers (info->self, info->headers, info->refresh, &info->err); 
    2198         info->cancelled = FALSE; 
     2233 
     2234        _tny_camel_account_stop_camel_operation (TNY_CAMEL_ACCOUNT (priv->account)); 
    21992235 
    22002236        if (info->err != NULL) { 
     
    22022238                        info->cancelled = TRUE; 
    22032239        } 
     2240 
     2241        g_static_rec_mutex_unlock (priv->folder_lock); 
    22042242 
    22052243        return NULL; 
     
    22182256        g_object_unref (info->headers); 
    22192257 
    2220         /**/ 
     2258        tny_idle_stopper_destroy (info->stopper); 
     2259        info->stopper = NULL; 
    22212260 
    22222261        camel_object_unref (info->session); 
     
    22592298        info->refresh = refresh; 
    22602299        info->callback = callback; 
     2300        info->status_callback = status_callback; 
    22612301        info->user_data = user_data; 
    22622302        info->err = NULL; 
     2303        info->stopper = tny_idle_stopper_new(); 
    22632304 
    22642305        /* thread reference */ 
     
    22802321                info, sizeof (GetHeadersInfo), 
    22812322                TNY_CAMEL_QUEUE_PRIORITY_ITEM/*|TNY_CAMEL_QUEUE_CANCELLABLE_ITEM*/| 
    2282                        TNY_CAMEL_QUEUE_GET_HEADERS_ITEM,  
     2323                TNY_CAMEL_QUEUE_GET_HEADERS_ITEM,  
    22832324                __FUNCTION__); 
    22842325