[nautilus/wip/oholy/progress-fixes] file-operations: Do not report remaining time if progress is not reported
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/oholy/progress-fixes] file-operations: Do not report remaining time if progress is not reported
- Date: Wed, 7 Oct 2020 13:04:28 +0000 (UTC)
commit 0935273d1258588fa2713c53f17eedd7b1a711b0
Author: Ondrej Holy <oholy redhat com>
Date: Mon Oct 5 15:02:06 2020 +0200
file-operations: Do not report remaining time if progress is not reported
Some GVfs backends doesn't report progress except the total file size. With
the previous patch applied, the remaining time is calculated after each
successfully transfered file for such backends. This is fine for small files,
but looks weird for big files as the estimated time is not updated regularly,
so it looks like hang. One possible solution would be to update the remaining
time periodically even if progress is not reported from GIO. However, this
could again lead to situations, which would look like that the transfer is
hanged. Let's do not report remaining time at all when progress is not reported
to reduce confusion.
src/nautilus-file-operations.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 690c286a2..5425ae0d7 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -181,6 +181,7 @@ typedef struct
OpKind op;
guint64 last_report_time;
int last_reported_files_left;
+ gboolean partial_progress;
} TransferInfo;
typedef struct
@@ -4066,7 +4067,8 @@ report_copy_progress (CopyMoveJob *copy_job,
}
if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE ||
- transfer_rate == 0)
+ transfer_rate == 0 ||
+ !transfer_info->partial_progress)
{
if (source_info->num_files == 1)
{
@@ -5074,6 +5076,11 @@ copy_file_progress_callback (goffset current_num_bytes,
pdata->source_info,
pdata->transfer_info);
}
+
+ if (current_num_bytes != total_num_bytes)
+ {
+ pdata->transfer_info->partial_progress = TRUE;
+ }
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]