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
055480aa
Commit
055480aa
authored
Jun 06, 2021
by
Alexander Stippich
Browse files
port deprecated methods away from FindDevicesThread
parent
e10c8794
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ksanewidget.cpp
View file @
055480aa
...
...
@@ -294,10 +294,19 @@ QString KSaneWidget::deviceModel() const
QString
KSaneWidget
::
vendor
()
const
{
d
->
m_findDevThread
->
wait
();
d
->
devListUpdated
();
// this is just a wrapped if (m_vendor.isEmpty()) statement if the vendor is known
// devListUpdated here is to ensure that we do not come in between finished and the devListUpdated slot
return
d
->
m_vendor
;
const
QString
&
vendor
=
deviceVendor
();
if
(
!
vendor
.
isEmpty
())
{
return
vendor
;
}
const
QString
&
name
=
deviceName
();
if
(
name
.
isEmpty
())
{
return
QString
();
}
QEventLoop
loop
;
connect
(
this
,
&
KSaneWidget
::
openedDeviceInfoUpdated
,
&
loop
,
&
QEventLoop
::
quit
,
Qt
::
QueuedConnection
);
loop
.
exec
();
return
deviceVendor
();
}
QString
KSaneWidget
::
make
()
const
...
...
@@ -307,10 +316,19 @@ QString KSaneWidget::make() const
QString
KSaneWidget
::
model
()
const
{
d
->
m_findDevThread
->
wait
();
d
->
devListUpdated
();
// this is just a wrapped if (m_vendor.isEmpty()) statement if the vendor is known
// devListUpdated here is to ensure that we do not come in between finished and the devListUpdated slot
return
d
->
m_model
;
const
QString
&
model
=
deviceModel
();
if
(
!
model
.
isEmpty
())
{
return
model
;
}
const
QString
&
name
=
deviceName
();
if
(
name
.
isEmpty
())
{
return
QString
();
}
QEventLoop
loop
;
connect
(
this
,
&
KSaneWidget
::
openedDeviceInfoUpdated
,
&
loop
,
&
QEventLoop
::
quit
,
Qt
::
QueuedConnection
);
loop
.
exec
();
return
deviceModel
();
}
QString
KSaneWidget
::
selectDevice
(
QWidget
*
parent
)
...
...
Write
Preview
Markdown
is supported
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