From 0c63b3a441437a8bc42770d360a6696bbf11cd2d Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sun, 31 Jul 2016 10:03:27 +0200 Subject: CAN: Use qUtf8Printable() instead qPrintable() for warnings From the qPrintable() help: "Note: qDebug(), qInfo(), qWarning(), qCritical(), qFatal() expect %s arguments to be UTF-8 encoded, while qPrintable() converts to local 8-bit encoding. Therefore qUtf8Printable() should be used for logging strings instead of qPrintable()." Change-Id: I724cc61659dd4f998617eade140b273dca841b35 Reviewed-by: Denis Shienkov Reviewed-by: Alex Blasche --- src/plugins/canbus/peakcan/main.cpp | 2 +- src/plugins/canbus/tinycan/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/canbus/peakcan/main.cpp b/src/plugins/canbus/peakcan/main.cpp index 94213f1..f3977ab 100644 --- a/src/plugins/canbus/peakcan/main.cpp +++ b/src/plugins/canbus/peakcan/main.cpp @@ -55,7 +55,7 @@ public: { QString errorReason; if (!PeakCanBackend::canCreate(&errorReason)) { - qWarning("%s", qPrintable(errorReason)); + qWarning("%s", qUtf8Printable(errorReason)); return nullptr; } diff --git a/src/plugins/canbus/tinycan/main.cpp b/src/plugins/canbus/tinycan/main.cpp index d020425..8dcfe5c 100644 --- a/src/plugins/canbus/tinycan/main.cpp +++ b/src/plugins/canbus/tinycan/main.cpp @@ -55,7 +55,7 @@ public: { QString errorReason; if (!TinyCanBackend::canCreate(&errorReason)) { - qWarning("%s", qPrintable(errorReason)); + qWarning("%s", qUtf8Printable(errorReason)); return nullptr; } -- cgit v1.2.3