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
94015db0
Commit
94015db0
authored
Mar 18, 2021
by
Alexander Stippich
Browse files
name the options more generic
parent
3777d843
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
94015db0
...
...
@@ -33,13 +33,13 @@ set(ksane_SRCS
splittercollapser.cpp
ksaneauth.cpp
options/ksaneoption.cpp
options/ksane
optbutt
on.cpp
options/ksane
optcheckbox
.cpp
options/ksane
optentry
.cpp
options/ksane
opt
gamma.cpp
options/ksane
optslider
.cpp
options/ksane
optfslider
.cpp
options/ksane
optcombo
.cpp
options/ksane
actionopti
on.cpp
options/ksane
booloption
.cpp
options/ksane
stringoption
.cpp
options/ksanegamma
option
.cpp
options/ksane
integeroption
.cpp
options/ksane
floatoption
.cpp
options/ksane
listoption
.cpp
options/ksaneinvertoption.cpp
)
...
...
src/ksanewidget.cpp
View file @
94015db0
...
...
@@ -35,13 +35,13 @@
#endif
#include "ksaneoption.h"
#include "ksane
optbutt
on.h"
#include "ksane
optcheckbox
.h"
#include "ksane
optcombo
.h"
#include "ksane
optentry
.h"
#include "ksane
optfslider
.h"
#include "ksane
opt
gamma.h"
#include "ksane
optslider
.h"
#include "ksane
actionopti
on.h"
#include "ksane
booloption
.h"
#include "ksane
listoption
.h"
#include "ksane
stringoption
.h"
#include "ksane
floatoption
.h"
#include "ksanegamma
option
.h"
#include "ksane
integeroption
.h"
#include "ksanedevicedialog.h"
#include "labeledgamma.h"
#include "ksaneinvertoption.h"
...
...
@@ -439,25 +439,25 @@ bool KSaneWidget::openDevice(const QString &deviceName)
d
->
m_optList
.
append
(
new
KSaneOption
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeBool
:
d
->
m_optList
.
append
(
new
KSane
OptCheckBox
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSane
BoolOption
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeInteger
:
d
->
m_optList
.
append
(
new
KSane
OptSlider
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSane
IntegerOption
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeFloat
:
d
->
m_optList
.
append
(
new
KSane
OptFSlider
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSane
FloatOption
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeValueList
:
d
->
m_optList
.
append
(
new
KSane
OptCombo
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSane
ListOption
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeString
:
d
->
m_optList
.
append
(
new
KSane
OptEntry
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSane
StringOption
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeGamma
:
d
->
m_optList
.
append
(
new
KSane
Opt
Gamma
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSaneGamma
Option
(
d
->
m_saneHandle
,
i
));
break
;
case
KSaneOption
::
TypeAction
:
d
->
m_optList
.
append
(
new
KSane
OptButt
on
(
d
->
m_saneHandle
,
i
));
d
->
m_optList
.
append
(
new
KSane
ActionOpti
on
(
d
->
m_saneHandle
,
i
));
break
;
}
}
...
...
src/options/ksane
optbutt
on.cpp
→
src/options/ksane
actionopti
on.cpp
View file @
94015db0
...
...
@@ -12,20 +12,20 @@
*
* ============================================================ */
#include "ksane
optbutt
on.h"
#include "ksane
actionopti
on.h"
#include <ksane_debug.h>
namespace
KSaneIface
{
KSane
OptButton
::
KSaneOptButt
on
(
const
SANE_Handle
handle
,
const
int
index
)
KSane
ActionOption
::
KSaneActionOpti
on
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
)
{
m_optionType
=
KSaneOption
::
TypeAction
;
}
bool
KSane
OptButt
on
::
setValue
(
const
QVariant
&
)
bool
KSane
ActionOpti
on
::
setValue
(
const
QVariant
&
)
{
unsigned
char
data
[
4
];
writeData
(
data
);
...
...
src/options/ksane
optbutt
on.h
→
src/options/ksane
actionopti
on.h
View file @
94015db0
...
...
@@ -19,12 +19,12 @@
namespace
KSaneIface
{
class
KSane
OptButt
on
:
public
KSaneOption
class
KSane
ActionOpti
on
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
OptButt
on
(
const
SANE_Handle
handle
,
const
int
index
);
KSane
ActionOpti
on
(
const
SANE_Handle
handle
,
const
int
index
);
public
Q_SLOTS
:
bool
setValue
(
const
QVariant
&
value
)
override
;
...
...
src/options/ksane
optcheckbox
.cpp
→
src/options/ksane
booloption
.cpp
View file @
94015db0
...
...
@@ -12,7 +12,7 @@
*
* ============================================================ */
// Local includes
#include "ksane
optcheckbox
.h"
#include "ksane
booloption
.h"
#include <QtCore/QVarLengthArray>
...
...
@@ -21,13 +21,13 @@
namespace
KSaneIface
{
KSane
OptCheckBox
::
KSaneOptCheckBox
(
const
SANE_Handle
handle
,
const
int
index
)
KSane
BoolOption
::
KSaneBoolOption
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
),
m_checked
(
false
)
{
m_optionType
=
KSaneOption
::
TypeBool
;
}
bool
KSane
OptCheckBox
::
setValue
(
const
QVariant
&
value
)
bool
KSane
BoolOption
::
setValue
(
const
QVariant
&
value
)
{
if
(
state
()
==
StateHidden
)
{
return
false
;
...
...
@@ -46,7 +46,7 @@ bool KSaneOptCheckBox::setValue(const QVariant &value)
return
true
;
}
void
KSane
OptCheckBox
::
readValue
()
void
KSane
BoolOption
::
readValue
()
{
if
(
state
()
==
StateHidden
)
{
return
;
...
...
@@ -68,7 +68,7 @@ void KSaneOptCheckBox::readValue()
}
}
QVariant
KSane
OptCheckBox
::
getValue
()
const
QVariant
KSane
BoolOption
::
getValue
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QVariant
();
...
...
@@ -76,7 +76,7 @@ QVariant KSaneOptCheckBox::getValue() const
return
m_checked
;
}
QString
KSane
OptCheckBox
::
getValueAsString
()
const
QString
KSane
BoolOption
::
getValueAsString
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QString
();
...
...
src/options/ksane
optcheckbox
.h
→
src/options/ksane
booloption
.h
View file @
94015db0
...
...
@@ -19,12 +19,12 @@
namespace
KSaneIface
{
class
KSane
OptCheckBox
:
public
KSaneOption
class
KSane
BoolOption
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
OptCheckBox
(
const
SANE_Handle
handle
,
const
int
index
);
KSane
BoolOption
(
const
SANE_Handle
handle
,
const
int
index
);
void
readValue
()
override
;
...
...
src/options/ksane
optfslider
.cpp
→
src/options/ksane
floatoption
.cpp
View file @
94015db0
...
...
@@ -12,7 +12,7 @@
*
* ============================================================ */
// Local includes
#include "ksane
optfslider
.h"
#include "ksane
floatoption
.h"
#include <QVarLengthArray>
...
...
@@ -24,13 +24,13 @@ static const float MIN_FIXED_STEP = 0.0001;
namespace
KSaneIface
{
KSane
OptFSlider
::
KSaneOptFSlider
(
const
SANE_Handle
handle
,
const
int
index
)
KSane
FloatOption
::
KSaneFloatOption
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
),
m_fVal
(
0
),
m_minChange
(
MIN_FIXED_STEP
)
{
m_optionType
=
KSaneOption
::
TypeFloat
;
}
void
KSane
OptFSlider
::
readOption
()
void
KSane
FloatOption
::
readOption
()
{
KSaneOption
::
readOption
();
...
...
@@ -44,7 +44,7 @@ void KSaneOptFSlider::readOption()
m_minChange
=
step
;
}
void
KSane
OptFSlider
::
readValue
()
void
KSane
FloatOption
::
readValue
()
{
if
(
state
()
==
StateHidden
)
{
return
;
...
...
@@ -64,7 +64,7 @@ void KSaneOptFSlider::readValue()
Q_EMIT
valueChanged
(
m_fVal
);
}
bool
KSane
OptFSlider
::
setValue
(
const
QVariant
&
value
)
bool
KSane
FloatOption
::
setValue
(
const
QVariant
&
value
)
{
if
(
state
()
==
StateHidden
)
{
return
false
;
...
...
@@ -84,7 +84,7 @@ bool KSaneOptFSlider::setValue(const QVariant &value)
return
ok
;
}
QVariant
KSane
OptFSlider
::
getMinValue
()
const
QVariant
KSane
FloatOption
::
getMinValue
()
const
{
QVariant
value
;
if
(
m_optDesc
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
...
...
@@ -95,7 +95,7 @@ QVariant KSaneOptFSlider::getMinValue() const
return
value
;
}
QVariant
KSane
OptFSlider
::
getMaxValue
()
const
QVariant
KSane
FloatOption
::
getMaxValue
()
const
{
QVariant
value
;
if
(
m_optDesc
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
...
...
@@ -106,7 +106,7 @@ QVariant KSaneOptFSlider::getMaxValue() const
return
value
;
}
QVariant
KSane
OptFSlider
::
getStepValue
()
const
QVariant
KSane
FloatOption
::
getStepValue
()
const
{
QVariant
value
;
if
(
m_optDesc
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
...
...
@@ -117,7 +117,7 @@ QVariant KSaneOptFSlider::getStepValue() const
return
value
;
}
QVariant
KSane
OptFSlider
::
getValue
()
const
QVariant
KSane
FloatOption
::
getValue
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QVariant
();
...
...
@@ -125,7 +125,7 @@ QVariant KSaneOptFSlider::getValue() const
return
QVariant
(
m_fVal
);
}
QString
KSane
OptFSlider
::
getValueAsString
()
const
QString
KSane
FloatOption
::
getValueAsString
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QString
();
...
...
src/options/ksane
optfslider
.h
→
src/options/ksane
floatoption
.h
View file @
94015db0
...
...
@@ -19,12 +19,12 @@
namespace
KSaneIface
{
class
KSane
OptFSlider
:
public
KSaneOption
class
KSane
FloatOption
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
OptFSlider
(
const
SANE_Handle
handle
,
const
int
index
);
KSane
FloatOption
(
const
SANE_Handle
handle
,
const
int
index
);
void
readValue
()
override
;
void
readOption
()
override
;
...
...
src/options/ksane
opt
gamma.cpp
→
src/options/ksanegamma
option
.cpp
View file @
94015db0
...
...
@@ -12,7 +12,7 @@
*
* ============================================================ */
#include "ksane
opt
gamma.h"
#include "ksanegamma
option
.h"
#include <QVarLengthArray>
...
...
@@ -23,13 +23,13 @@
namespace
KSaneIface
{
KSane
Opt
Gamma
::
KSane
Opt
Gamma
(
const
SANE_Handle
handle
,
const
int
index
)
KSaneGamma
Option
::
KSaneGamma
Option
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
)
{
m_optionType
=
KSaneOption
::
TypeGamma
;
}
bool
KSane
Opt
Gamma
::
setValue
(
const
QVariant
&
value
)
bool
KSaneGamma
Option
::
setValue
(
const
QVariant
&
value
)
{
if
(
state
()
==
StateHidden
)
{
return
false
;
...
...
@@ -79,7 +79,7 @@ bool KSaneOptGamma::setValue(const QVariant &value)
return
false
;
}
void
KSane
Opt
Gamma
::
readOption
()
void
KSaneGamma
Option
::
readOption
()
{
KSaneOption
::
readOption
();
...
...
@@ -92,13 +92,13 @@ void KSaneOptGamma::readOption()
}
}
void
KSane
Opt
Gamma
::
readValue
()
void
KSaneGamma
Option
::
readValue
()
{
// Unfortunately gamma table to brightness, contrast and gamma is
// not easy nor fast.. ergo not done
}
QVariant
KSane
Opt
Gamma
::
getValue
()
const
QVariant
KSaneGamma
Option
::
getValue
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QVariant
();
...
...
@@ -106,7 +106,7 @@ QVariant KSaneOptGamma::getValue() const
return
QVariant
::
fromValue
(
QVector
<
int
>
{
m_brightness
,
m_contrast
,
m_gamma
});
}
QVariant
KSane
Opt
Gamma
::
getMaxValue
()
const
QVariant
KSaneGamma
Option
::
getMaxValue
()
const
{
QVariant
value
;
if
(
m_optDesc
)
{
...
...
@@ -116,7 +116,7 @@ QVariant KSaneOptGamma::getMaxValue() const
return
value
;
}
QString
KSane
Opt
Gamma
::
getValueAsString
()
const
QString
KSaneGamma
Option
::
getValueAsString
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QString
();
...
...
@@ -125,7 +125,7 @@ QString KSaneOptGamma::getValueAsString() const
return
QString
::
asprintf
(
"%d:%d:%d"
,
m_brightness
,
m_contrast
,
m_gamma
);
}
void
KSane
Opt
Gamma
::
calculateGTwriteData
()
void
KSaneGamma
Option
::
calculateGTwriteData
()
{
double
maxValue
=
m_optDesc
->
constraint
.
range
->
max
;
double
gamma
=
100.0
/
m_gamma
;
...
...
src/options/ksane
opt
gamma.h
→
src/options/ksanegamma
option
.h
View file @
94015db0
...
...
@@ -19,12 +19,12 @@
namespace
KSaneIface
{
class
KSane
Opt
Gamma
:
public
KSaneOption
class
KSaneGamma
Option
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
Opt
Gamma
(
const
SANE_Handle
handle
,
const
int
index
);
KSaneGamma
Option
(
const
SANE_Handle
handle
,
const
int
index
);
void
readValue
()
override
;
void
readOption
()
override
;
...
...
src/options/ksane
optslider
.cpp
→
src/options/ksane
integeroption
.cpp
View file @
94015db0
...
...
@@ -12,7 +12,7 @@
*
* ============================================================ */
#include "ksane
optslider
.h"
#include "ksane
integeroption
.h"
#include <QVarLengthArray>
...
...
@@ -22,13 +22,13 @@ static const int KSW_INT_MIN = -2147483647 - 1; // prevent warning
namespace
KSaneIface
{
KSane
OptSlider
::
KSaneOptSlider
(
const
SANE_Handle
handle
,
const
int
index
)
KSane
IntegerOption
::
KSaneIntegerOption
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
),
m_iVal
(
0
)
{
m_optionType
=
KSaneOption
::
TypeInteger
;
}
void
KSane
OptSlider
::
readValue
()
void
KSane
IntegerOption
::
readValue
()
{
if
(
state
()
==
StateHidden
)
{
return
;
...
...
@@ -48,7 +48,7 @@ void KSaneOptSlider::readValue()
Q_EMIT
valueChanged
(
m_iVal
);
}
QVariant
KSane
OptSlider
::
getMinValue
()
const
QVariant
KSane
IntegerOption
::
getMinValue
()
const
{
QVariant
value
;
if
(
m_optDesc
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
...
...
@@ -59,7 +59,7 @@ QVariant KSaneOptSlider::getMinValue() const
return
value
;
}
QVariant
KSane
OptSlider
::
getMaxValue
()
const
QVariant
KSane
IntegerOption
::
getMaxValue
()
const
{
QVariant
value
;
if
(
m_optDesc
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
...
...
@@ -70,7 +70,7 @@ QVariant KSaneOptSlider::getMaxValue() const
return
value
;
}
QVariant
KSane
OptSlider
::
getStepValue
()
const
QVariant
KSane
IntegerOption
::
getStepValue
()
const
{
QVariant
value
;
if
(
m_optDesc
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
...
...
@@ -81,7 +81,7 @@ QVariant KSaneOptSlider::getStepValue() const
return
value
;
}
QVariant
KSane
OptSlider
::
getValue
()
const
QVariant
KSane
IntegerOption
::
getValue
()
const
{
QVariant
value
;
if
(
state
()
==
StateHidden
)
{
...
...
@@ -91,7 +91,7 @@ QVariant KSaneOptSlider::getValue() const
return
value
;
}
QString
KSane
OptSlider
::
getValueAsString
()
const
QString
KSane
IntegerOption
::
getValueAsString
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QString
();
...
...
@@ -99,7 +99,7 @@ QString KSaneOptSlider::getValueAsString() const
return
QString
::
number
(
m_iVal
);
}
bool
KSane
OptSlider
::
setValue
(
const
QVariant
&
val
)
bool
KSane
IntegerOption
::
setValue
(
const
QVariant
&
val
)
{
bool
ok
;
int
newValue
=
val
.
toInt
(
&
ok
);
...
...
src/options/ksane
optslider
.h
→
src/options/ksane
integeroption
.h
View file @
94015db0
...
...
@@ -19,12 +19,12 @@
namespace
KSaneIface
{
class
KSane
OptSlider
:
public
KSaneOption
class
KSane
IntegerOption
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
OptSlider
(
const
SANE_Handle
handle
,
const
int
index
);
KSane
IntegerOption
(
const
SANE_Handle
handle
,
const
int
index
);
void
readValue
()
override
;
...
...
src/options/ksane
optcombo
.cpp
→
src/options/ksane
listoption
.cpp
View file @
94015db0
...
...
@@ -12,7 +12,7 @@
*
* ============================================================ */
#include "ksane
optcombo
.h"
#include "ksane
listoption
.h"
#include <QVarLengthArray>
#include <QLocale>
...
...
@@ -22,13 +22,13 @@
namespace
KSaneIface
{
KSane
OptCombo
::
KSaneOptCombo
(
const
SANE_Handle
handle
,
const
int
index
)
KSane
ListOption
::
KSaneListOption
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
)
{
m_optionType
=
KSaneOption
::
TypeValueList
;
}
void
KSane
OptCombo
::
readValue
()
void
KSane
ListOption
::
readValue
()
{
if
(
state
()
==
StateHidden
)
{
return
;
...
...
@@ -64,7 +64,7 @@ void KSaneOptCombo::readValue()
}
}
QVariantList
KSane
OptCombo
::
getEntryList
()
const
QVariantList
KSane
ListOption
::
getEntryList
()
const
{
int
i
;
QVariantList
list
;
...
...
@@ -94,7 +94,7 @@ QVariantList KSaneOptCombo::getEntryList() const
return
list
;
}
bool
KSane
OptCombo
::
setValue
(
const
QVariant
&
value
)
bool
KSane
ListOption
::
setValue
(
const
QVariant
&
value
)
{
bool
success
=
false
;
if
(
static_cast
<
QMetaType
::
Type
>
(
value
.
type
())
==
QMetaType
::
QString
)
{
...
...
@@ -106,7 +106,7 @@ bool KSaneOptCombo::setValue(const QVariant &value)
return
success
;
}
QVariant
KSane
OptCombo
::
getMinValue
()
const
QVariant
KSane
ListOption
::
getMinValue
()
const
{
QVariant
value
;
if
(
state
()
==
StateHidden
)
{
...
...
@@ -136,7 +136,7 @@ QVariant KSaneOptCombo::getMinValue() const
return
value
;
}
QVariant
KSane
OptCombo
::
getValue
()
const
QVariant
KSane
ListOption
::
getValue
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QVariant
();
...
...
@@ -144,7 +144,7 @@ QVariant KSaneOptCombo::getValue() const
return
m_currentValue
;
}
bool
KSane
OptCombo
::
setValue
(
float
value
)
bool
KSane
ListOption
::
setValue
(
float
value
)
{
unsigned
char
data
[
4
];
float
tmp
;
...
...
@@ -188,7 +188,7 @@ bool KSaneOptCombo::setValue(float value)
return
false
;
}
QString
KSane
OptCombo
::
getValueAsString
()
const
QString
KSane
ListOption
::
getValueAsString
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QString
();
...
...
@@ -196,7 +196,7 @@ QString KSaneOptCombo::getValueAsString() const
return
m_currentValue
.
toString
();
}
bool
KSane
OptCombo
::
setValue
(
const
QString
&
value
)
bool
KSane
ListOption
::
setValue
(
const
QString
&
value
)
{
if
(
state
()
==
StateHidden
)
{
return
false
;
...
...
src/options/ksane
optcombo
.h
→
src/options/ksane
listoption
.h
View file @
94015db0
...
...
@@ -21,12 +21,12 @@
namespace
KSaneIface
{
class
KSane
OptCombo
:
public
KSaneOption
class
KSane
ListOption
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
OptCombo
(
const
SANE_Handle
handle
,
const
int
index
);
KSane
ListOption
(
const
SANE_Handle
handle
,
const
int
index
);
void
readValue
()
override
;
...
...
src/options/ksane
optentry
.cpp
→
src/options/ksane
stringoption
.cpp
View file @
94015db0
...
...
@@ -12,7 +12,7 @@
*
* ============================================================ */
// Local includes
#include "ksane
optentry
.h"
#include "ksane
stringoption
.h"
#include <QVarLengthArray>
...
...
@@ -21,13 +21,13 @@
namespace
KSaneIface
{
KSane
OptEntry
::
KSaneOptEntry
(
const
SANE_Handle
handle
,
const
int
index
)
KSane
StringOption
::
KSaneStringOption
(
const
SANE_Handle
handle
,
const
int
index
)
:
KSaneOption
(
handle
,
index
)
{
m_optionType
=
KSaneOption
::
TypeString
;
}
bool
KSane
OptEntry
::
setValue
(
const
QVariant
&
val
)
bool
KSane
StringOption
::
setValue
(
const
QVariant
&
val
)
{
if
(
state
()
==
StateHidden
)
{
return
false
;
...
...
@@ -42,7 +42,7 @@ bool KSaneOptEntry::setValue(const QVariant &val)
return
true
;
}
void
KSane
OptEntry
::
readValue
()
void
KSane
StringOption
::
readValue
()
{
if
(
state
()
==
StateHidden
)
{
return
;
...
...
@@ -62,12 +62,12 @@ void KSaneOptEntry::readValue()
Q_EMIT
valueChanged
(
m_string
);
}
QVariant
KSane
OptEntry
::
getValue
()
const
QVariant
KSane
StringOption
::
getValue
()
const
{
return
QVariant
(
m_string
);
}
QString
KSane
OptEntry
::
getValueAsString
()
const
QString
KSane
StringOption
::
getValueAsString
()
const
{
if
(
state
()
==
StateHidden
)
{
return
QString
();
...
...
src/options/ksane
optentry
.h
→
src/options/ksane
stringoption
.h
View file @
94015db0
...
...
@@ -19,12 +19,12 @@
namespace
KSaneIface
{
class
KSane
OptEntry
:
public
KSaneOption
class
KSane
StringOption
:
public
KSaneOption
{
Q_OBJECT
public:
KSane
OptEntry
(
const
SANE_Handle
handle
,
const
int
index
);