summaryrefslogtreecommitdiff
path: root/src/torrent.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-12-21 00:32:54 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-12-21 00:32:54 +0000
commitec64e995ab1467596e75fb0aebda63bb047aefa5 (patch)
tree07d4d1f73b33085b8f87d9c0ae56a2548a1bc9be /src/torrent.c
parent980ecb422cb29f93f5fe51b633be46cde36cedc6 (diff)
file trees :D may do cascading priority changes sometime, but this is a start. also use GTK_STOCK_FILE if mime/extension detection fails.
Diffstat (limited to 'src/torrent.c')
-rw-r--r--src/torrent.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/torrent.c b/src/torrent.c
index c7562a4..ab123c3 100644
--- a/src/torrent.c
+++ b/src/torrent.c
@@ -606,11 +606,10 @@ gint64 peerfrom_get_lpd(JsonObject * pf)
/* files */
-gdouble file_get_progress(JsonObject * f)
+gdouble file_get_progress(gint64 length, gint64 completed)
{
- gint64 length = file_get_length(f);
if (length > 0) {
- return ((gdouble) file_get_bytes_completed(f) /
+ return ((gdouble) completed /
(gdouble) length) * 100.0;
} else {
return 0.0;