From 00f40e6771680cd0af6f48da71c3db0d7aa06532 Mon Sep 17 00:00:00 2001 From: Tilka Date: Sun, 1 Jul 2012 22:14:16 +0200 Subject: [PATCH 1/2] Fix torrent transfer stats --- src/webui/btjson.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index a1b95039a..fc4e9fa3c 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -284,13 +284,13 @@ QString btjson::getPropertiesForTorrent(const QString& hash) data.add(KEY_PROP_UPLOADED, QString(misc::friendlyUnit(h.all_time_upload()) + " (" + misc::friendlyUnit(h.total_payload_upload()) + " " + tr("this session") + ")")); data.add(KEY_PROP_DOWNLOADED, QString(misc::friendlyUnit(h.all_time_download()) + " (" + misc::friendlyUnit(h.total_payload_download()) + " " + tr("this session") + ")")); if (h.upload_limit() <= 0) - data.add(KEY_PROP_UPLOADED, QString::fromUtf8("∞")); + data.add(KEY_PROP_UP_LIMIT, QString::fromUtf8("∞")); else - data.add(KEY_PROP_UPLOADED, misc::friendlyUnit(h.upload_limit(), true)); + data.add(KEY_PROP_UP_LIMIT, misc::friendlyUnit(h.upload_limit(), true)); if (h.download_limit() <= 0) - data.add(KEY_PROP_DOWNLOADED, QString::fromUtf8("∞")); + data.add(KEY_PROP_DL_LIMIT, QString::fromUtf8("∞")); else - data.add(KEY_PROP_DOWNLOADED, misc::friendlyUnit(h.download_limit(), true)); + data.add(KEY_PROP_DL_LIMIT, misc::friendlyUnit(h.download_limit(), true)); QString elapsed_txt = misc::userFriendlyDuration(h.active_time()); if (h.is_seed()) elapsed_txt += " ("+tr("Seeded for %1", "e.g. Seeded for 3m10s").arg(misc::userFriendlyDuration(h.seeding_time()))+")"; From ca26cc000076d9844e843d494d827450d05559b3 Mon Sep 17 00:00:00 2001 From: Tilka Date: Sun, 1 Jul 2012 22:59:12 +0200 Subject: [PATCH 2/2] Fix torrent transfer stats, 2nd try The constants themselves were also mixed up. --- src/webui/btjson.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index fc4e9fa3c..d88efce1b 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -88,8 +88,8 @@ static const char KEY_PROP_CREATION_DATE[] = "creation_date"; static const char KEY_PROP_PIECE_SIZE[] = "piece_size"; static const char KEY_PROP_COMMENT[] = "comment"; static const char KEY_PROP_WASTED[] = "total_wasted"; -static const char KEY_PROP_DOWNLOADED[] = "total_uploaded"; -static const char KEY_PROP_UPLOADED[] = "total_downloaded"; +static const char KEY_PROP_UPLOADED[] = "total_uploaded"; +static const char KEY_PROP_DOWNLOADED[] = "total_downloaded"; static const char KEY_PROP_UP_LIMIT[] = "up_limit"; static const char KEY_PROP_DL_LIMIT[] = "dl_limit"; static const char KEY_PROP_TIME_ELAPSED[] = "time_elapsed";