mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-07 10:42:07 +00:00
Show total downloaded and uploaded bytes (fixes #377)
Rename "Connections.Connection c" to "Connections.Connection total"
This commit is contained in:
parent
030a7c7bc3
commit
fc5a99cd5c
1 changed files with 6 additions and 4 deletions
|
@ -305,14 +305,16 @@ public class StatusFragment extends ListFragment implements SyncthingService.OnS
|
|||
if (getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
Connections.Connection c = connections.total;
|
||||
Connections.Connection total = connections.total;
|
||||
synchronized (mStatusHolderLock) {
|
||||
/**
|
||||
* Hide the rates on the UI if they are lower than 1 KByte/sec. We don't like to
|
||||
* "Hide" rates on the UI if they are lower than 1 KByte/sec. We don't like to
|
||||
* bother the user looking at discovery or index exchange traffic.
|
||||
*/
|
||||
mDownload = (c.inBits / 8 < 1024) ? "" : Util.readableTransferRate(mActivity, c.inBits);
|
||||
mUpload = (c.outBits / 8 < 1024) ? "" : Util.readableTransferRate(mActivity, c.outBits);
|
||||
mDownload = (total.inBits / 8 < 1024) ? "0 B/s" : Util.readableTransferRate(mActivity, total.inBits);
|
||||
mDownload += " (" + Util.readableFileSize(mActivity, total.inBytesTotal) + ")";
|
||||
mUpload = (total.outBits / 8 < 1024) ? "0 B/s" : Util.readableTransferRate(mActivity, total.outBits);
|
||||
mUpload += " (" + Util.readableFileSize(mActivity, total.outBytesTotal) + ")";
|
||||
}
|
||||
updateStatus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue