mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: do not assume properties contain latin1 characters only
the SYMLINK property for example is documented to (maybe) contain UTF-8 encoded characters, for reference: https://man7.org/linux/man-pages/man7/udev.7.html Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
dd24df3950
commit
ad01edf194
2 changed files with 6 additions and 6 deletions
|
@ -98,7 +98,7 @@ static inline QStringList listFromListEntry(struct udev_list_entry *list)
|
|||
QStringList ret;
|
||||
struct udev_list_entry *entry;
|
||||
udev_list_entry_foreach(entry, list) {
|
||||
ret << QString::fromLatin1(udev_list_entry_get_name(entry));
|
||||
ret << QString::fromUtf8(udev_list_entry_get_name(entry));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ QString Device::devType() const
|
|||
if (!m_device) {
|
||||
return QString();
|
||||
}
|
||||
return QString::fromLatin1(udev_device_get_devtype(m_device));
|
||||
return QString::fromUtf8(udev_device_get_devtype(m_device));
|
||||
}
|
||||
|
||||
QString Device::name() const
|
||||
|
@ -90,7 +90,7 @@ QString Device::name() const
|
|||
if (!m_device) {
|
||||
return QString();
|
||||
}
|
||||
return QString::fromLatin1(udev_device_get_sysname(m_device));
|
||||
return QString::fromUtf8(udev_device_get_sysname(m_device));
|
||||
}
|
||||
|
||||
QString Device::sysfsPath() const
|
||||
|
@ -98,7 +98,7 @@ QString Device::sysfsPath() const
|
|||
if (!m_device) {
|
||||
return QString();
|
||||
}
|
||||
return QString::fromLatin1(udev_device_get_syspath(m_device));
|
||||
return QString::fromUtf8(udev_device_get_syspath(m_device));
|
||||
}
|
||||
|
||||
int Device::sysfsNumber() const
|
||||
|
@ -156,7 +156,7 @@ QString Device::deviceProperty(const QByteArray &name) const
|
|||
if (!m_device) {
|
||||
return QString();
|
||||
}
|
||||
return QString::fromLatin1(udev_device_get_property_value(m_device, name.constData()));
|
||||
return QString::fromUtf8(udev_device_get_property_value(m_device, name.constData()));
|
||||
}
|
||||
|
||||
QString Device::sysfsProperty(const QByteArray &name) const
|
||||
|
@ -164,7 +164,7 @@ QString Device::sysfsProperty(const QByteArray &name) const
|
|||
if (!m_device) {
|
||||
return QString();
|
||||
}
|
||||
return QString::fromLatin1(udev_device_get_sysattr_value(m_device, name.constData()));
|
||||
return QString::fromUtf8(udev_device_get_sysattr_value(m_device, name.constData()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue