finch/gntxfer.c

changeset 38584
9cde452b1bc6
parent 37114
581adbabe319
child 39823
36acf9e724a5
equal deleted inserted replaced
38582:878de3ba891b 38584:9cde452b1bc6
53 53
54 static PurpleGntXferDialog *xfer_dialog = NULL; 54 static PurpleGntXferDialog *xfer_dialog = NULL;
55 55
56 typedef struct 56 typedef struct
57 { 57 {
58 time_t last_updated_time; 58 gint64 last_updated_time;
59 gboolean in_list; 59 gboolean in_list;
60 60
61 char *name; 61 char *name;
62 gboolean notified; /* Has the completion of the transfer been notified? */ 62 gboolean notified; /* Has the completion of the transfer been notified? */
63 63
388 void 388 void
389 finch_xfer_dialog_update_xfer(PurpleXfer *xfer) 389 finch_xfer_dialog_update_xfer(PurpleXfer *xfer)
390 { 390 {
391 PurpleGntXferUiData *data; 391 PurpleGntXferUiData *data;
392 char *size_str, *remaining_str; 392 char *size_str, *remaining_str;
393 time_t current_time; 393 gint64 current_time;
394 char prog_str[5]; 394 char prog_str[5];
395 double kb_sent; 395 double kb_sent;
396 double kbps = 0.0; 396 double kbps = 0.0;
397 time_t elapsed, now; 397 time_t elapsed, now;
398 char *kbsec; 398 char *kbsec;
412 return; 412 return;
413 413
414 if (data->in_list == FALSE || data->notified) 414 if (data->in_list == FALSE || data->notified)
415 return; 415 return;
416 416
417 current_time = time(NULL); 417 current_time = g_get_monotonic_time();
418 if (((current_time - data->last_updated_time) == 0) && 418 if (((current_time - data->last_updated_time) < G_USEC_PER_SEC) &&
419 (!purple_xfer_is_completed(xfer))) { 419 (!purple_xfer_is_completed(xfer))) {
420 /* Don't update the window more than once per second */ 420 /* Don't update the window more than once per second */
421 return; 421 return;
422 } 422 }
423 data->last_updated_time = current_time; 423 data->last_updated_time = current_time;

mercurial