summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-11-02 16:29:54 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-08 16:19:40 +0100
commite9c1fa70442a55c3ad8a1fe2f0fd322272a48d8d (patch)
treefe936ba57e2473892b62502970c50a714bb780b6 /src
parent030f4f7d8839f1f5070fd1f4d385e775c0ef66bd (diff)
Unify the QString creation from udev return values (char*)
Change-Id: Ic69fd0d62d3097685bc8c3e25a7d8f6c696d7e2a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/serialport/qserialportinfo_unix.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/serialport/qserialportinfo_unix.cpp b/src/serialport/qserialportinfo_unix.cpp
index 955b6b14..849f4e08 100644
--- a/src/serialport/qserialportinfo_unix.cpp
+++ b/src/serialport/qserialportinfo_unix.cpp
@@ -251,10 +251,8 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
QSerialPortInfo serialPortInfo;
- serialPortInfo.d_ptr->device =
- QLatin1String(::udev_device_get_devnode(dev));
- serialPortInfo.d_ptr->portName =
- QLatin1String(::udev_device_get_sysname(dev));
+ serialPortInfo.d_ptr->device = QString::fromLatin1(::udev_device_get_devnode(dev));
+ serialPortInfo.d_ptr->portName = QString::fromLatin1(::udev_device_get_sysname(dev));
struct ::udev_device *parentdev = ::udev_device_get_parent(dev);
@@ -262,17 +260,15 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
if (parentdev) {
- QLatin1String subsys(::udev_device_get_subsystem(parentdev));
+ QString subsys = QString::fromLatin1(::udev_device_get_subsystem(parentdev));
if (subsys == QStringLiteral("usb-serial")
|| subsys == QStringLiteral("usb")) { // USB bus type
// Append this devices and try get additional information about them.
- serialPortInfo.d_ptr->description = QString(
- QLatin1String(::udev_device_get_property_value(dev,
- "ID_MODEL"))).replace(QLatin1Char('_'), QLatin1Char(' '));
- serialPortInfo.d_ptr->manufacturer = QString(
- QLatin1String(::udev_device_get_property_value(dev,
- "ID_VENDOR"))).replace(QLatin1Char('_'), QLatin1Char(' '));
+ serialPortInfo.d_ptr->description = QString::fromLatin1(::udev_device_get_property_value(dev,
+ "ID_MODEL")).replace(QLatin1Char('_'), QLatin1Char(' '));
+ serialPortInfo.d_ptr->manufacturer = QString::fromLatin1(::udev_device_get_property_value(dev,
+ "ID_VENDOR")).replace(QLatin1Char('_'), QLatin1Char(' '));
serialPortInfo.d_ptr->vendorIdentifier =
QString::fromLatin1(::udev_device_get_property_value(dev,