Changeset 1307
- Timestamp:
- 12/08/06 17:26:56
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/bindings/python/tinymail.override (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-operation.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (9 diffs)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (3 diffs)
- trunk/libtinymail/tny-shared.h (modified) (1 diff)
- trunk/tinymail/tny-demoui-summary-view.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1306 r1307 3 3 * Added the tny_folder_transfer_msgs_async API 4 4 * Implemented for libtinymail-camel 5 * Fixed some progress/status numbers and changed its API 5 6 6 7 * This was a major API change trunk/bindings/python/tinymail.override
r1299 r1307 169 169 170 170 static void 171 tny_refresh_folder_status_cb (TnyFolder *self, const gchar *what, gint status, g pointer user_data)171 tny_refresh_folder_status_cb (TnyFolder *self, const gchar *what, gint status, gint oftotal, gpointer user_data) 172 172 { 173 173 PyObject *callback, *args, *ret; … … 176 176 state = pyg_gil_state_ensure(); 177 177 callback = PyTuple_GetItem((PyObject *)user_data, 1); 178 args = Py_BuildValue("(Nsi O)",178 args = Py_BuildValue("(NsiiO)", 179 179 pygobject_new((GObject *)self), 180 what, status, 180 what, status, oftotal, 181 181 PyTuple_GetItem((PyObject *)user_data, 2)); 182 182 ret = PyObject_CallObject(callback, args); trunk/libtinymail-camel/camel-lite/camel/camel-operation.c
r1014 r1307 514 514 s->msg = msg; 515 515 s->flags = 0; 516 s->pc = 0; 516 517 cc->lastreport = s; 517 518 cc->status_stack = g_slist_prepend(cc->status_stack, s); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r1175 r1307 2375 2375 2376 2376 static guint32 2377 imap_get_uids (CamelFolder *folder, CamelImapStore *store, CamelException *ex, GPtrArray *needheaders, int size , int got)2377 imap_get_uids (CamelFolder *folder, CamelImapStore *store, CamelException *ex, GPtrArray *needheaders, int size) 2378 2378 { 2379 2379 char *resp = NULL; … … 2382 2382 CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); 2383 2383 GData *data; 2384 2384 2385 2385 while ((type = camel_imap_command_response (store, &resp, ex)) == 2386 2386 CAMEL_IMAP_RESPONSE_UNTAGGED) … … 2393 2393 g_ptr_array_add (needheaders, g_strdup (g_datalist_get_data (&data, "UID"))); 2394 2394 if (size > 0) 2395 camel_operation_progress (NULL, got * 100/ size);2395 camel_operation_progress (NULL, cnt / size); 2396 2396 g_datalist_clear (&data); 2397 2397 } … … 2419 2419 GData *data; 2420 2420 gboolean more = TRUE; 2421 unsigned int nextn, cnt=0, tcnt=0, ucnt=0 ;2421 unsigned int nextn, cnt=0, tcnt=0, ucnt=0, rec=0; 2422 2422 2423 2423 if (!store->ostream || !store->istream) … … 2467 2467 2468 2468 camel_operation_start (NULL, _("Fetching summary information for new messages in %s"), folder->name); 2469 cnt = imap_get_uids (folder, store, ex, needheaders, size, got);2469 cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq)); 2470 2470 tcnt += cnt; 2471 2471 camel_operation_end (NULL); … … 2482 2482 { g_warning ("IMAP error getting UIDs (2)"); 2483 2483 camel_operation_end (NULL); return; } 2484 cnt = imap_get_uids (folder, store, ex, needheaders, size, got);2484 cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq) - cnt); 2485 2485 tcnt += cnt; 2486 2486 /* If we still received too few */ … … 2494 2494 { g_warning ("IMAP error getting UIDs (3)"); 2495 2495 camel_operation_end (NULL); return; } 2496 tcnt = cnt = imap_get_uids (folder, store, ex, needheaders, size, got);2496 tcnt = cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq) - tcnt); 2497 2497 } 2498 2498 … … 2569 2569 ucnt++; 2570 2570 camel_folder_summary_add (folder->summary, (CamelMessageInfo *)mi); 2571 / /camel_folder_change_info_add_uid (changes, camel_message_info_uid (mi));2572 2573 //if ((mi->info.flags & CAMEL_IMAP_MESSAGE_RECENT))2574 //camel_folder_change_info_recent_uid(changes, camel_message_info_uid (mi));2571 /*camel_folder_change_info_add_uid (changes, camel_message_info_uid (mi)); 2572 2573 if ((mi->info.flags & CAMEL_IMAP_MESSAGE_RECENT)) 2574 camel_folder_change_info_recent_uid(changes, camel_message_info_uid (mi));*/ 2575 2575 2576 2576 } … … 2588 2588 got += IMAP_PRETEND_SIZEOF_HEADERS; 2589 2589 if (size > 0) 2590 camel_operation_progress (NULL, got * 100 / size);2590 camel_operation_progress (NULL, uid / needheaders->len); 2591 2591 } 2592 2592 g_datalist_clear (&data); trunk/libtinymail-camel/tny-camel-folder.c
r1306 r1307 596 596 RefreshFolderInfo *minfo; 597 597 gchar *what; 598 gint pc ;598 gint pc, oftotal; 599 599 } ProgressInfo; 600 600 … … 618 618 { 619 619 ProgressInfo *info = data; 620 const gchar *what = (const gchar*)info->what;621 620 RefreshFolderInfo *minfo = info->minfo; 622 gint pc = info->pc;623 621 624 622 if (minfo && minfo->status_callback) 625 623 { 626 minfo->status_callback (minfo->self, 627 (const gchar*)what, (gint)pc, minfo->user_data);624 minfo->status_callback (minfo->self, (const gchar*)info->what, 625 info->pc, info->oftotal, minfo->user_data); 628 626 } 629 627 … … 660 658 info->minfo->status_callback = oinfo->status_callback; 661 659 info->minfo->user_data = oinfo->user_data; 662 info->pc = pc; 660 info->oftotal = 100; 661 662 if (pc < 0) 663 info->pc = 0; 664 else 665 if (pc > info->oftotal) 666 info->pc = info->oftotal; 667 else 668 info->pc = pc; 663 669 664 670 /* gidle reference */ trunk/libtinymail/tny-shared.h
r1306 r1307 52 52 typedef void (*TnyGetMsgCallback) (TnyFolder *folder, TnyMsg *msg, GError **err, gpointer user_data); 53 53 typedef void (*TnyTransferMsgsCallback) (TnyFolder *folder, GError **err, gpointer user_data); 54 typedef void (*TnyRefreshFolderStatusCallback) (TnyFolder *self, const gchar *what, gint status, g pointer user_data);54 typedef void (*TnyRefreshFolderStatusCallback) (TnyFolder *self, const gchar *what, gint status, gint oftotal, gpointer user_data); 55 55 typedef enum _TnyHeaderFlags TnyHeaderFlags; 56 56 typedef enum _TnyAlertType TnyAlertType; trunk/tinymail/tny-demoui-summary-view.c
r1305 r1307 442 442 443 443 static void 444 refresh_current_folder_status_update (TnyFolder *folder, const gchar *what, gint status, g pointer user_data)444 refresh_current_folder_status_update (TnyFolder *folder, const gchar *what, gint status, gint oftotal, gpointer user_data) 445 445 { 446 446 TnyDemouiSummaryViewPriv *priv = user_data; 447 448 gtk_progress_bar_pulse (GTK_PROGRESS_BAR (priv->progress)); 447 gdouble fraq = (((gdouble) status) / (( gdouble) oftotal)); 448 449 gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress), fraq); 450 /* gtk_progress_bar_pulse (GTK_PROGRESS_BAR (priv->progress)); */ 449 451 gtk_statusbar_pop (GTK_STATUSBAR (priv->status), priv->status_id); 450 452 gtk_statusbar_push (GTK_STATUSBAR (priv->status), priv->status_id, what);
