diff options
author | Elliott Sales de Andrade <qulogic@pidgin.im> | 2017-07-10 21:40:59 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <qulogic@pidgin.im> | 2017-07-10 21:40:59 -0400 |
commit | 624a2ddb127331a8df68c28d7b5bf7e7ef2ea5ba (patch) | |
tree | 2f490d5375749d948d5f0f62293a2bad01bd7aa2 /finch/gntxfer.c | |
parent | 05b04a2430531076e61f18acfcbaa6a47f663165 (diff) | |
download | pidgin-624a2ddb127331a8df68c28d7b5bf7e7ef2ea5ba.tar.gz |
Use monotonic time for UI-related timestamping.
These do not need to be printed or cached between runs, so they don't
need to be absolutely correct.
Also, remove unused timestamp from gtkblist.
Diffstat (limited to 'finch/gntxfer.c')
-rw-r--r-- | finch/gntxfer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/finch/gntxfer.c b/finch/gntxfer.c index 1641885ba6..c38f170b3a 100644 --- a/finch/gntxfer.c +++ b/finch/gntxfer.c @@ -55,7 +55,7 @@ static PurpleGntXferDialog *xfer_dialog = NULL; typedef struct { - time_t last_updated_time; + gint64 last_updated_time; gboolean in_list; char *name; @@ -390,7 +390,7 @@ finch_xfer_dialog_update_xfer(PurpleXfer *xfer) { PurpleGntXferUiData *data; char *size_str, *remaining_str; - time_t current_time; + gint64 current_time; char prog_str[5]; double kb_sent; double kbps = 0.0; @@ -414,8 +414,8 @@ finch_xfer_dialog_update_xfer(PurpleXfer *xfer) if (data->in_list == FALSE || data->notified) return; - current_time = time(NULL); - if (((current_time - data->last_updated_time) == 0) && + current_time = g_get_monotonic_time(); + if (((current_time - data->last_updated_time) < G_USEC_PER_SEC) && (!purple_xfer_is_completed(xfer))) { /* Don't update the window more than once per second */ return; |