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
Unmaintained
KDE Libraries
Commits
e672faca
Commit
e672faca
authored
May 06, 2011
by
Lamarque Souza
Browse files
Fill in vendor and model names using Solid's udev backend when possible.
REVIEW: 101270 (cherry picked from commit
fdf93b29
)
parent
a944a097
Changes
2
Hide whitespace changes
Inline
Side-by-side
solid/solid/backends/udev/udevdevice.cpp
View file @
e672faca
...
...
@@ -71,12 +71,15 @@ QString UDevDevice::vendor() const
vendor
=
m_device
.
deviceProperty
(
"ID_VENDOR"
).
toString
().
replace
(
'_'
,
" "
);
}
else
if
(
queryDeviceInterface
(
Solid
::
DeviceInterface
::
NetworkInterface
))
{
vendor
=
m_device
.
deviceProperty
(
"ID_VENDOR_FROM_DATABASE"
).
toString
();
}
else
if
(
queryDeviceInterface
(
Solid
::
DeviceInterface
::
AudioInterface
))
{
}
else
if
(
queryDeviceInterface
(
Solid
::
DeviceInterface
::
AudioInterface
))
{
if
(
m_device
.
parent
().
isValid
())
{
vendor
=
m_device
.
parent
().
deviceProperty
(
"ID_VENDOR_FROM_DATABASE"
).
toString
();
}
}
if
(
vendor
.
isEmpty
())
{
vendor
=
m_device
.
deviceProperty
(
"ID_VENDOR"
).
toString
().
replace
(
'_'
,
' '
);
}
}
return
vendor
;
}
...
...
@@ -111,6 +114,10 @@ QString UDevDevice::product() const
product
.
append
(
QLatin1String
(
"USB Serial Port"
));
}
}
if
(
product
.
isEmpty
())
{
product
=
m_device
.
deviceProperty
(
"ID_MODEL"
).
toString
().
replace
(
'_'
,
' '
);
}
}
return
product
;
}
...
...
solid/solid/backends/udev/udevmanager.cpp
View file @
e672faca
...
...
@@ -191,7 +191,7 @@ QObject *UDevManager::createDevice(const QString &udi_)
}
const
QString
udi
=
udi_
.
right
(
udi_
.
size
()
-
udiPrefix
().
size
());
UdevQt
::
Device
device
=
d
->
m_client
->
deviceBySysfsPath
(
udi
);
if
(
d
->
isOfInterest
(
device
))
{
if
(
d
->
isOfInterest
(
device
)
||
QFile
::
exists
(
udi
)
)
{
return
new
UDevDevice
(
device
);
}
return
0
;
...
...
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