Commit 085eb929 authored by Alexander Stippich's avatar Alexander Stippich
Browse files

remove special signal of KSaneOptCheckBox

parent 61b7ed11
......@@ -464,18 +464,15 @@ bool KSaneWidget::openDevice(const QString &deviceName)
}
// do the connections of the option parameters
for (i = 0; i < d->m_optList.size(); ++i) {
//qCDebug(KSANE_LOG) << d->m_optList.at(i)->name();
connect(d->m_optList.at(i), &KSaneOption::optionsNeedReload, d, &KSaneWidgetPrivate::reloadOptions);
connect(d->m_optList.at(i), &KSaneOption::valuesNeedReload, d, &KSaneWidgetPrivate::scheduleValuesReload);
if (d->m_optList.at(i)->needsPolling()) {
//qCDebug(KSANE_LOG) << d->m_optList.at(i)->name() << " needs polling";
d->m_pollList.append(d->m_optList.at(i));
KSaneOptCheckBox *buttonOption = qobject_cast<KSaneOptCheckBox *>(d->m_optList.at(i));
if (buttonOption) {
connect(buttonOption, &KSaneOptCheckBox::buttonPressed,
this, &KSaneWidget::buttonPressed);
for (const auto &option : qAsConst(d->m_optList)) {
connect(option, &KSaneOption::optionsNeedReload, d, &KSaneWidgetPrivate::reloadOptions);
connect(option, &KSaneOption::valuesNeedReload, d, &KSaneWidgetPrivate::scheduleValuesReload);
if (option->needsPolling()) {
d->m_pollList.append(option);
if (option->type() == KSaneOption::TypeBool) {
connect( option, &KSaneOption::valueChanged,
[=]( const QVariant &newValue ) { Q_EMIT buttonPressed(option->name(), option->title(), newValue.toBool()); } );
}
}
}
......
......@@ -64,7 +64,6 @@ void KSaneOptCheckBox::readValue()
m_checked = (toSANE_Word(data.data()) != 0) ? true : false;
if ((old != m_checked) && ((m_optDesc->cap & SANE_CAP_SOFT_SELECT) == 0)) {
Q_EMIT buttonPressed(name(), sane_i18n(m_optDesc->title), m_checked);
Q_EMIT valueChanged(m_checked);
}
}
......
......@@ -34,9 +34,6 @@ public:
public Q_SLOTS:
bool setValue(const QVariant &value) override;
Q_SIGNALS:
void buttonPressed(const QString &optionName, const QString &optionLabel, bool pressed);
private:
bool m_checked;
};
......
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