Commit 4ec51219 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Trk: Fix source code scanning tool issues.

showing up in Qt.
parent 73609768
......@@ -583,17 +583,19 @@ void Launcher::handleSupportMask(const TrkResult &result)
return;
const char *data = result.data.data() + 1;
QByteArray str;
QString str = QLatin1String("SUPPORTED: ");
for (int i = 0; i < 32; ++i) {
//str.append(" [" + formatByte(data[i]) + "]: ");
for (int j = 0; j < 8; ++j)
if (data[i] & (1 << j))
str.append(QByteArray::number(i * 8 + j, 16) + " ");
for (int j = 0; j < 8; ++j) {
if (data[i] & (1 << j)) {
str.append(QString::number(i * 8 + j, 16));
str.append(QLatin1Char(' '));
}
}
}
logMessage("SUPPORTED: " + str);
logMessage(str);
}
void Launcher::cleanUp()
{
//
......
......@@ -133,9 +133,9 @@ QString Session::deviceDescription(unsigned verbose) const
// FIXME: Use the QByteArray based version below?
QString stringFromByte(byte c)
static inline QString stringFromByte(byte c)
{
return QString("%1 ").arg(c, 2, 16, QChar('0'));
return QString::fromLatin1("%1").arg(c, 2, 16, QChar('0'));
}
QString stringFromArray(const QByteArray &ba, int maxLen)
......@@ -188,9 +188,12 @@ void TrkResult::clear()
QString TrkResult::toString() const
{
QString res = stringFromByte(code) + "[" + stringFromByte(token);
res.chop(1);
return res + "] " + stringFromArray(data);
QString res = stringFromByte(code);
res += QLatin1String(" [");
res += stringFromByte(token);
res += QLatin1Char(']');
res += stringFromArray(data);
return res;
}
QByteArray frameMessage(byte command, byte token, const QByteArray &data, bool serialFrame)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment