Commit 992fd7c7 authored by Anton Arnold's avatar Anton Arnold Committed by Kåre Särs
Browse files

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

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.

Reviewers: sars, #kde_applications

Reviewed By: sars

Subscribers: aacid

Differential Revision: https://phabricator.kde.org/D25588
parent ee889af4
......@@ -429,9 +429,9 @@ void KSaneWidgetPrivate::createOptInterface()
}
}
// Color Options
for (int i = 0; i < basic_layout->count(); ++i) {
if (basic_layout->itemAt(i) && basic_layout->itemAt(i)->widget()) {
tmpOption = qobject_cast<KSaneOptionWidget *>(basic_layout->itemAt(i)->widget());
for (int i = 0; i < color_lay->count(); ++i) {
if (color_lay->itemAt(i) && color_lay->itemAt(i)->widget()) {
tmpOption = qobject_cast<KSaneOptionWidget *>(color_lay->itemAt(i)->widget());
if (tmpOption) {
labelWidth = qMax(labelWidth, tmpOption->labelWidthHint());
}
......
......@@ -34,6 +34,7 @@
#include <QDebug>
#include <QIcon>
#include <QLocale>
namespace KSaneIface
{
......@@ -341,7 +342,7 @@ bool KSaneOptCombo::setValue(const QString &val)
case SANE_TYPE_INT:
tmp = val.left(val.indexOf(QLatin1Char(' '))); // strip the unit
// accept float formatting of the string
i = (int)(tmp.toFloat(&ok));
i = (int)(QLocale::system().toFloat(tmp,&ok));
if (ok == false) {
return false;
}
......@@ -350,7 +351,7 @@ bool KSaneOptCombo::setValue(const QString &val)
break;
case SANE_TYPE_FIXED:
tmp = val.left(val.indexOf(QLatin1Char(' '))); // strip the unit
f = tmp.toFloat(&ok);
f = QLocale::system().toFloat(tmp,&ok);
if (ok == false) {
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment