Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
libksane
Commits
085eb929
Commit
085eb929
authored
Mar 07, 2021
by
Alexander Stippich
Browse files
remove special signal of KSaneOptCheckBox
parent
61b7ed11
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ksanewidget.cpp
View file @
085eb929
...
...
@@ -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
());
}
);
}
}
}
...
...
src/options/ksaneoptcheckbox.cpp
View file @
085eb929
...
...
@@ -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
);
}
}
...
...
src/options/ksaneoptcheckbox.h
View file @
085eb929
...
...
@@ -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
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment