[QML Monitor] Show remaining time as soon as possible
ClosedPublic

Authored by bruns on Apr 18 2020, 6:48 PM.

Details

Summary

The update timer was started when the content indexing started. If a large
file is encountered during the first second, the estimate could stay
at "Estimating" for a considerable amount of time.

If baloo_file has already indexed some files, an estimate is available
immediately. Replace the QElapsedTimer with a QDeadlineTimer and
initialize it to expired, so the first file triggers an estimate update.

Test Plan

make sure baloo_has indexed enough files for an estimate (5 batches)
touch a big file -> estimate is shown immediately

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Apr 18 2020, 6:48 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 18 2020, 6:48 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Apr 18 2020, 6:48 PM
apol added a subscriber: apol.Apr 19 2020, 3:11 PM

You're using QDeadlineTimer weird. Why don't you use QDeadlineTimer::remainingTime() and ::setDeadline?

bruns added a comment.Apr 19 2020, 4:30 PM
In D28956#651795, @apol wrote:

You're using QDeadlineTimer weird. Why don't you use QDeadlineTimer::remainingTime() and ::setDeadline?

Because both functions do a syscall.

ngraham accepted this revision.Apr 25 2020, 2:43 PM
This revision is now accepted and ready to land.Apr 25 2020, 2:43 PM
This revision was automatically updated to reflect the committed changes.