Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4522315e authored by Hans Boehm's avatar Hans Boehm
Browse files

Restore cached timestamp correctly

Bug: 33751444

When reinitializing the calculator after restarting in RESULT state,
we were reconstructing the last history entry from the main expression,
without correctly restoring the timestamp. Instead read the expression,
together with its timestamp, from the database.

Correctly distinguish between result-already-saved and
result-not-yet-saved states when evaluation completes.
There may be very odd cases in which we generate an error the first
time, setting the state to INIT, and successfully evaluate the
second time (because we need less precision) that the old logic
didn't handle. And testing for INIT_FOR_RESULT is cleaner anyway.
(We can still, under very weird conditions, put expressions in the
history that generate an error after evaluating correctly the
first time. We should be robust against that already.)

Add a couple of comments that would have made this easier to track
down.

Change-Id: I85756cca5d8fb76b2cbeb9ed32a788ae71b6d65e
parent 83f278ed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment