https://bugs.kde.org/show_bug.cgi?id=412401

            Bug ID: 412401
           Summary: Sometimes chained operations cause 'forgetting' of
                    inserted constants or pasted numbers
           Product: kcalc
           Version: 19.08.1
          Platform: Archlinux Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: ete...@alum.rit.edu
          Reporter: oleg.pop...@gmail.com
  Target Milestone: ---

SUMMARY
KCalc has a very annoying bug which manifests as forgetting entered constants
and numbers pasted from the clipboard when they are followed by an operation
other than '=' or '%' if the operation stack is not empty.

STEPS TO REPRODUCE
1. Click 'AC'
2. Click '+'
3. Either insert a "scientific" constant from the menu, or click a constant
button, or paste a number from the clipboard
4. Click '+'

OBSERVED RESULT
The displayed number is '0'.

EXPECTED RESULT
The entered constant or pasted number must be displayed (i.e. number + 0). The
correct behavior is observed if the number is entered manually at step 3.

SOFTWARE/OS VERSIONS
Windows: x
macOS: x
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.13.1
KCalc version: 19.08.1

ADDITIONAL INFORMATION
A possible solution is to call CalcEngine::setOnlyUpdateOperation(false)
wherever applicable (e.g. core.setOnlyUpdateOperation(false) in
KCalculator::slotConstantToDisplay()). However, I believe it would be better to
implement a common method or slot for number insertion so that the same code
would not get scattered over multiple places thereby adding to the technical
debt. Also, this case should be covered by a set of tests.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to