Fix color-options layout & KSaneOptCombo::setValue()
ClosedPublic

Authored by antonarnold on Nov 28 2019, 12:42 PM.

Details

Summary

BUG: 414601
BUG: 414602

This diff contains bugfixes that I fixed while developing the scan area+option ordering enhancements but are not related directly to them.

The items in the color layout where not updated correctly.
Remove the group separator before trying to write a value to a combo-box option.

Diff Detail

Repository
R382 KSane Library
Lint
Lint Skipped
Unit
Unit Tests Skipped
antonarnold requested review of this revision.Nov 28 2019, 12:42 PM
antonarnold created this revision.
aacid added a subscriber: aacid.Nov 28 2019, 6:20 PM

Can we get a better description?

Like Fix when bla and bla happens

sars accepted this revision.Nov 29 2019, 11:00 AM
sars retitled this revision from Smaller bugfixes for libksane to Fix color-options layout & KSaneOptCombo::setValue().
sars edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 29 2019, 11:00 AM
sars added a comment.Nov 29 2019, 11:02 AM

BTW should this also be done to to other options setting numbers?

In D25588#569248, @sars wrote:

BTW should this also be done to to other options setting numbers?

I think the combo box is the only inherited class that has this problem. It is caused by applying i18n on the unit but not considering it in the read path but not in the set path.
Just found the information in the Qt documentation in QString::toFloat(): The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toFloat()
I guess this would ultimately be the best solution since the current bugfix probably won't support decimals (which I did not encounter in the DPI settings).

sars added a comment.Dec 11 2019, 8:39 PM

Do you want to send a new version or should I Just remove the separator removal and use "... = QLocale::toFloat(tmp);" and commit in your name?

I'll change it and check directly if everything behaves correctly. Shouldn't take long.

Now uses correct localized number conversion

This revision was automatically updated to reflect the committed changes.