From: Fredrik Tolf Date: Mon, 11 Nov 2019 01:13:54 +0000 (+0100) Subject: Properly process Gtk2 error-times as gint64s. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=4f0d9ba6afe60e0b0091baa188026000b206ebc4;p=doldaconnect.git Properly process Gtk2 error-times as gint64s. --- diff --git a/clients/gtk2/dolcon.c b/clients/gtk2/dolcon.c index bf2117b..a5adc12 100644 --- a/clients/gtk2/dolcon.c +++ b/clients/gtk2/dolcon.c @@ -421,7 +421,7 @@ void transspeedinfo(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel void transerrorinfo(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { int error; - time_t errortime; + gint64 errortime; char finbuf[64], tbuf[64], *errstr; gtk_tree_model_get(model, iter, 10, &error, 11, &errortime, -1); @@ -431,7 +431,7 @@ void transerrorinfo(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel errstr = _("Not found"); else if(error == DC_TRNSE_NOSLOTS) errstr = _("No slots"); - strftime(tbuf, 64, _("%H:%M:%S"), localtime(&errortime)); + strftime(tbuf, 64, _("%H:%M:%S"), localtime((const time_t[]){errortime})); snprintf(finbuf, 64, _("%s (reported at %s)"), errstr, tbuf); } else { *finbuf = 0; @@ -480,8 +480,7 @@ void updatetransferlists(void) char *buf; char *peerid, *peernick, *path, *hash; int state, dir, error; - gint64 size, curpos; - time_t errortime; + gint64 size, curpos, errortime; GtkListStore *stores[3]; for(transfer = dc_transfers; transfer != NULL; transfer = transfer->next) @@ -570,7 +569,7 @@ void updatetransferlists(void) 8, gettrstatestock(transfer->state), 9, 0.0, 10, transfer->error, - 11, transfer->errortime, + 11, (gint64)transfer->errortime, 12, hash, -1); free(peerid); @@ -2288,7 +2287,7 @@ int main(int argc, char **argv) G_TYPE_STRING, /* stock */ G_TYPE_FLOAT, /* percentage */ G_TYPE_INT, /* error */ - G_TYPE_INT, /* errortime */ + G_TYPE_INT64, /* errortime */ G_TYPE_STRING); /* hash */ gtk_tree_view_set_model(GTK_TREE_VIEW(main_downloads), GTK_TREE_MODEL(dlmodel));