+void progressfunc(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
+{
+ int totalc, curc;
+ gint64 total, cur;
+ char buf[64];
+
+ totalc = (GPOINTER_TO_INT(data) & 0xff00) >> 8;
+ curc = GPOINTER_TO_INT(data) & 0xff;
+ gtk_tree_model_get(model, iter, totalc, &total, curc, &cur, -1);
+ if(total < 1)
+ g_object_set(rend, "value", GINT_TO_POINTER(0), NULL);
+ else
+ g_object_set(rend, "value", GINT_TO_POINTER((int)(((double)cur / (double)total) * 100)), NULL);
+ if(cur < 0) {
+ g_object_set(rend, "text", "", NULL);
+ } else {
+ snprintf(buf, 64, "%'ji", (intmax_t)cur);
+ g_object_set(rend, "text", buf, NULL);
+ }
+}
+