Changeset 3726
- Timestamp:
- 07/23/08 13:42:24
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-account.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3725 r3726 1 2008-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 1 11 2008-07-21 Jose Dapena Paz <jdapena@igalia.com> 2 12 trunk/libtinymail-camel/tny-camel-account.c
r3705 r3726 782 782 priv->cancel = camel_operation_new (func, user_data); 783 783 784 camel_operation_register (priv->cancel); 784 785 camel_operation_start (priv->cancel, (char*)what); 785 786 trunk/libtinymail-camel/tny-camel-folder.c
r3704 r3726 2189 2189 gboolean refresh; 2190 2190 TnyGetHeadersCallback callback; 2191 TnyStatusCallback status_callback; 2191 2192 gpointer user_data; 2192 2193 TnySessionCamel *session; 2193 2194 gboolean cancelled; 2195 TnyIdleStopper *stopper; 2194 2196 2195 2197 } GetHeadersInfo; … … 2209 2211 if (info->err) 2210 2212 g_error_free (info->err); 2213 2214 tny_idle_stopper_destroy (info->stopper); 2215 info->stopper = NULL; 2211 2216 2212 2217 /**/ … … 2226 2231 tny_lockable_unlock (info->session->priv->ui_lock); 2227 2232 } 2233 tny_idle_stopper_stop (info->stopper); 2234 2228 2235 return FALSE; 2229 2236 } 2237 2238 static void 2239 tny_camel_folder_get_headers_async_status (struct _CamelOperation *op, const char *what, int sofar, int oftotal, void *thr_user_data) 2240 { 2241 GetHeadersInfo *oinfo = thr_user_data; 2242 TnyProgressInfo *info = NULL; 2243 2244 info = tny_progress_info_new (G_OBJECT (oinfo->self), oinfo->status_callback, 2245 TNY_FOLDER_STATUS, TNY_FOLDER_STATUS_CODE_GET_MSG, what, sofar, 2246 oftotal, oinfo->stopper, oinfo->session->priv->ui_lock, oinfo->user_data); 2247 2248 g_idle_add_full (TNY_PRIORITY_LOWER_THAN_GTK_REDRAWS, 2249 tny_progress_info_idle_func, info, 2250 tny_progress_info_destroy); 2251 2252 return; 2253 } 2254 2230 2255 2231 2256 static gpointer … … 2233 2258 { 2234 2259 GetHeadersInfo *info = (GetHeadersInfo*) thr_user_data; 2260 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->self); 2261 2235 2262 info->err = NULL; 2263 info->cancelled = FALSE; 2264 2265 g_static_rec_mutex_lock (priv->folder_lock); 2266 2267 _tny_camel_account_start_camel_operation (TNY_CAMEL_ACCOUNT (priv->account), 2268 tny_camel_folder_get_headers_async_status, 2269 info, "Getting headers"); 2270 2236 2271 tny_folder_get_headers (info->self, info->headers, info->refresh, &info->err); 2237 info->cancelled = FALSE; 2272 2273 _tny_camel_account_stop_camel_operation (TNY_CAMEL_ACCOUNT (priv->account)); 2238 2274 2239 2275 if (info->err != NULL) { … … 2241 2277 info->cancelled = TRUE; 2242 2278 } 2279 2280 g_static_rec_mutex_unlock (priv->folder_lock); 2243 2281 2244 2282 return NULL; … … 2257 2295 g_object_unref (info->headers); 2258 2296 2259 /**/ 2297 tny_idle_stopper_destroy (info->stopper); 2298 info->stopper = NULL; 2260 2299 2261 2300 camel_object_unref (info->session); … … 2298 2337 info->refresh = refresh; 2299 2338 info->callback = callback; 2339 info->status_callback = status_callback; 2300 2340 info->user_data = user_data; 2301 2341 info->err = NULL; 2342 info->stopper = tny_idle_stopper_new(); 2302 2343 2303 2344 /* thread reference */ … … 2319 2360 info, sizeof (GetHeadersInfo), 2320 2361 TNY_CAMEL_QUEUE_PRIORITY_ITEM/*|TNY_CAMEL_QUEUE_CANCELLABLE_ITEM*/| 2321 TNY_CAMEL_QUEUE_GET_HEADERS_ITEM,2362 TNY_CAMEL_QUEUE_GET_HEADERS_ITEM, 2322 2363 __FUNCTION__); 2323 2364
