Bug 353644

Summary: Constants buttons do not work
Product: [Applications] kcalc Reporter: JohnB <john.barnes>
Component: generalAssignee: Evan Teran <evan.teran>
Status: RESOLVED FIXED    
Severity: normal CC: ciclista41, laurent.rineau, luigi.toscano, petrielmjr, ramsoft, rdieter, wellingtonwallace
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 15.12.3
Sentry Crash Report:

Description JohnB 2015-10-07 09:45:03 UTC
The constants buttons can be defined and configured to appear but clicking on the does not produce the constant

Reproducible: Always

Steps to Reproduce:
1. Click "Configure KCalc" in settings and define a constant - e.g. PI
2. In settings select "Constants buttons"
3. Click defined constant button, PI

Actual Results:  
Nothing happens

Expected Results:  
3.14159265 should appear

Defining any other constant or constant button is possible, but similarly, clicking on them produces no output.
Comment 1 JohnB 2015-10-07 09:46:58 UTC
Kcalc version 2.13 on Fedora 22 running KDE Frameworks 5.14.0, Qt 5.5.0, Plasma 5.4.1
Comment 2 Wellington 2015-10-23 13:59:51 UTC
I have the same problem on Arch Linux using kcalc 15.08.2, frameworks 5.15, Qt 5.5.1(built against 5.5.0) and plasma-desktop 5.4.2
Comment 3 ralph 2016-01-17 21:18:13 UTC
Same problem on openSUSE Leap 42.1
KCalc 15.12.0 - KDE Frameworks 5.18.0 - Qt 5.5.1 (built against 5.5.1)
Comment 4 Lester Petrie 2016-02-04 22:09:36 UTC
I have the same bug on Fedora 23, KCalc 15.12.1-KDE Frameworks 5.18.0-Qt 5.5.1.  In addition to being unable to retrieve a constant, storing the display in one of the constants doesn't work either.  The behavior is very like kcalc doesn't recognize that the constant button has been clicked.  Being unable to retrieve one of the predefined constants is a hassle, but not too bad.  Not being able to use the additional storage is much more irritating.  Ctrl-C and Ctrl-V don't seem to work either.
Comment 5 Bruce 2016-02-15 05:08:14 UTC
I have the same bug on Archlinux using kcalc 15.12.1-KDE Frameworks 5.18.0-QT 5.5.1 (built against 5.5.1).
Comment 6 Luigi Toscano 2016-02-15 13:34:35 UTC
I think it's a bug connected with the changes in the signal/slot system. I proposed a patch here:
https://git.reviewboard.kde.org/r/127017/
but I'd really like to have a comment from the maintainer (or one of the people who helped with the Qt5 porting, or anyone with better internal knowledge of Qt then me) before proceeding.
Of course feel free to test it.
Comment 7 Luigi Toscano 2016-03-08 22:20:03 UTC
Git commit a4dfbe234f8a6d1a052c36e535be60f030bf35ca by Luigi Toscano.
Committed on 08/03/2016 at 22:19.
Pushed by ltoscano into branch 'Applications/15.12'.

Fix click event for constant buttons

It looks like the new style of "connect" tries to use the clicked
signal as defined inside the function, which does not trigger
slotClicked(). This change explicitly use the clicked signal from
the (grand)parent class and the expected chain of signal/slots
triggering is restored.
REVIEW: 127017
FIXED-IN: 15.12.3

M  +1    -1    kcalc_const_button.cpp

http://commits.kde.org/kcalc/a4dfbe234f8a6d1a052c36e535be60f030bf35ca
Comment 8 Bruce 2016-03-09 03:36:45 UTC
Thanks, Luigi!  I look forward to using the fixed version when it becomes available on Archlinux.