Bug 489041 - Pressing Enter or = doesn't always clear the display field
Summary: Pressing Enter or = doesn't always clear the display field
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.05.1
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Gabriel Barrantes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-23 11:40 UTC by popov895
Modified: 2024-07-04 21:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2024-06-23 11:40:31 UTC
SUMMARY

Since 24.05.0, there is an input field that contains an expression and an output field that contains the temporary result of calculating this expression. Pressing Enter or = moves the calculation result to the input field and clears the display field, but sometimes the display field doesn't clear. Actually, this is not a significant bug, but rather an inconsistent behavior.

STEPS TO REPRODUCE

1. Enter 55*2 - input field contains 55*2, display field contains 110
2. Press Enter - input field contains 110, display field is empty
3. Press cos - input field contains cos(110), display field contains -0,342020143326
4. Press Enter - both input field and display field contain -0,342020143326
5. Enter *2 - input field contains -0,342020143326*2, display field contains -0,684040286652
6. Press Enter - both input field and display field contain -0,684040286652
7. Further, for any operation, the display field is never cleared

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20240618
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
KDE Gear Version: 24.05.1
Qt Version: 6.7.1
Comment 1 Gabriel Barrantes 2024-06-23 15:34:43 UTC
(In reply to popov895 from comment #0)
> SUMMARY
> 
> Since 24.05.0, there is an input field that contains an expression and an
> output field that contains the temporary result of calculating this
> expression. Pressing Enter or = moves the calculation result to the input
> field and clears the display field, but sometimes the display field doesn't
> clear. Actually, this is not a significant bug, but rather an inconsistent
> behavior.
> 
> STEPS TO REPRODUCE
> 
> 1. Enter 55*2 - input field contains 55*2, display field contains 110
> 2. Press Enter - input field contains 110, display field is empty
> 3. Press cos - input field contains cos(110), display field contains
> -0,342020143326
> 4. Press Enter - both input field and display field contain -0,342020143326
> 5. Enter *2 - input field contains -0,342020143326*2, display field contains
> -0,684040286652
> 6. Press Enter - both input field and display field contain -0,684040286652
> 7. Further, for any operation, the display field is never cleared
> 
> SOFTWARE/OS VERSIONS
> 
> Operating System: openSUSE Tumbleweed 20240618
> KDE Plasma Version: 6.0.5
> KDE Frameworks Version: 6.3.0
> KDE Gear Version: 24.05.1
> Qt Version: 6.7.1

this happens due to the "-", Should be easy enough to fix...
Comment 2 Bug Janitor Service 2024-06-26 01:36:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kcalc/-/merge_requests/109
Comment 3 Gabriel Barrantes 2024-07-04 21:03:23 UTC
Git commit f6ad26e2f34980c2f74b5f42f85764aa048d296b by Gabriel Barrantes.
Committed on 04/07/2024 at 20:58.
Pushed by gabrielbarrantes into branch 'master'.

Clear result display on single negative number

Display should clear when input is a single number, this covers the
case when the number is negative.

M  +10   -4    kcalc_parser.cpp

https://invent.kde.org/utilities/kcalc/-/commit/f6ad26e2f34980c2f74b5f42f85764aa048d296b