mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
265 stars 143 forks source link

caja-file-operations: fix estimate for queued copy #1759

Open basicmaster opened 6 months ago

basicmaster commented 6 months ago

Fixes the condition for showing an estimate of the remaining duration in case a copy operation is queued, aligning to the delete operation case.

lukefromdc commented 5 months ago

Just retested this. Didn't notice any build warnings from the file other than the usual deprecation warnings with default build options.

On queuing multiple large files that push the drive to its limit, the first file reads accurate rate and the second (waiting) file does not show a transfer rate. When it starts, the indicated transfer rate starts low and quickly accelerates, on a large enough file would presumably reach the true data rate but copying to /tmp I ran out of file before it could show full speed. That's with disk images and multi-GB filesystem backups as the test files.

Seems to me this is a much better behavior than we get now, and I didn't get any refusals of the dialog to work properly in a quick test

faulesocke commented 5 months ago

Fixing this properly should be easier: Just reset elapsed to zero when the job actually starts. Also reset it when it is manually unpaused by the user (which might be the same code path, haven't looked into it).

basicmaster commented 5 months ago

@faulesocke: You actually refer to the changes in #1758, aren't you?

The case to pause a job after it started (e.g. when copying multiple files) has also to be considered here. In that case you definitely need to stop/continue the timer, otherwise you would again start at zero time and get a wrong estimate.