Bug 159239 - KIntNumInput handles keyboard input incorrectly when suffixes are enabled
Summary: KIntNumInput handles keyboard input incorrectly when suffixes are enabled
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kdeui (show other bugs)
Version: SVN
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 13:49 UTC by albert
Modified: 2008-03-13 22:58 UTC (History)
2 users (show)

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


Attachments
Quick patch that seems to fix the problem (488 bytes, patch)
2008-03-13 22:50 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description albert 2008-03-13 13:49:15 UTC
Version:            (using KDE 4.0.2)
Installed from:    Ubuntu Packages
OS:                Linux

After you have inserted a new value for opacity, via keyboard, and pressed the "apply" button or the "return" key, the opacity value is reseted to zero. Editing this setting with arrows works properly.
Comment 1 Pino Toscano 2008-03-13 14:02:10 UTC
Nothing fancy in the way we use that standard KDE widget.
Comment 2 Pino Toscano 2008-03-13 14:49:34 UTC
The problem seems related to the usage of a suffix for the spinbox.
Commenting out its usage by the opacity spinbox in Okular makes it working normally.
Comment 3 Thomas McGuire 2008-03-13 16:49:35 UTC
KMail has the same problem, it uses "bytes" as suffix, and keyboard input does not work correctly.
Comment 4 Albert Astals Cid 2008-03-13 22:43:02 UTC
Basically KIntSpinBox::textFromValue and KIntSpinBox::valueFromText ignore the fact that the text can have a suffix so it does not work, using the QSpinBox variants is not possible there because we have the very useful base setting that probably noone uses but breaks the 99% used code :-/
Comment 5 Albert Astals Cid 2008-03-13 22:50:10 UTC
Created attachment 23888 [details]
Quick patch that seems to fix the problem

I was about to commit it, but i'd want some comments first
Comment 6 Albert Astals Cid 2008-03-13 22:58:54 UTC
SVN commit 785377 by aacid:

chop the suffix before doing the int conversion

BUG: 159239


 M  +3 -1      knuminput.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=785377