summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2020-10-05 14:34:45 +0200
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2021-01-17 22:50:56 +0000
commit7d29b05e4513e38c3f1cccf7b8092d7dc2ef8530 (patch)
treea99476eefbdedf725661236256217314a0809aa3
parent1bab20c7422dd5af08b0a2de6aa25363b8da3403 (diff)
downloadnautilus-7d29b05e4513e38c3f1cccf7b8092d7dc2ef8530.tar.gz
file-operations: Do not report remaining time if not yet computed
Currently, the remaining time for some operations is reported even if it hasn't been yet computed. Consequently, "596,523 hours left" is shown to the user as it corresponds to the initial value, which is INT_MAX. In most cases this is because some GVfs backend doesn't report progress except the total file size. Let's do not report remaining time if transfer rate is 0, ie. remaing time is not computed. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/232
-rw-r--r--src/nautilus-file-operations.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index ed2feda10..1be9770be 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -1846,7 +1846,8 @@ report_delete_progress (CommonJob *job,
}
}
- if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE)
+ if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE ||
+ transfer_rate == 0)
{
if (files_left > 0)
{
@@ -2236,7 +2237,8 @@ report_trash_progress (CommonJob *job,
}
}
- if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE)
+ if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE ||
+ transfer_rate == 0)
{
if (files_left > 0)
{
@@ -4146,8 +4148,8 @@ report_copy_progress (CopyMoveJob *copy_job,
}
}
- if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE &&
- transfer_rate > 0)
+ if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE ||
+ transfer_rate == 0)
{
if (source_info->num_files == 1)
{