Prefer rvalue version of toLocal8Bit()
... to re-use existing buffers. Change-Id: I5907a2e29d7f7dac04df5bf50769b47131e175d8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
8bd67f61a6
commit
ce124d5119
|
|
@ -466,7 +466,7 @@ QByteArray QXcbIntegration::wmClass() const
|
|||
}
|
||||
|
||||
if (!name.isEmpty() && !className.isEmpty())
|
||||
m_wmClass = name.toLocal8Bit() + '\0' + className.toLocal8Bit() + '\0';
|
||||
m_wmClass = std::move(name).toLocal8Bit() + '\0' + std::move(className).toLocal8Bit() + '\0';
|
||||
}
|
||||
return m_wmClass;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -911,7 +911,7 @@ bool QPSQLDriver::open(const QString & db,
|
|||
connectString.append(QLatin1Char(' ')).append(opt);
|
||||
}
|
||||
|
||||
d->connection = PQconnectdb(connectString.toLocal8Bit().constData());
|
||||
d->connection = PQconnectdb(std::move(connectString).toLocal8Bit().constData());
|
||||
if (PQstatus(d->connection) == CONNECTION_BAD) {
|
||||
setLastError(qMakeError(tr("Unable to connect"), QSqlError::ConnectionError, d));
|
||||
setOpenError(true);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ static QByteArray msgBeginFailed(const char *function, const DOCINFO &d)
|
|||
str << ", document \"" << QString::fromWCharArray(d.lpszDocName) << '"';
|
||||
if (d.lpszOutput && d.lpszOutput[0])
|
||||
str << ", file \"" << QString::fromWCharArray(d.lpszOutput) << '"';
|
||||
return result.toLocal8Bit();
|
||||
return std::move(result).toLocal8Bit();
|
||||
}
|
||||
|
||||
bool QWin32PrintEngine::begin(QPaintDevice *pdev)
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ int main(int argc, char **argv)
|
|||
output.write("<node>\n");
|
||||
for (const ClassDef &cdef : qAsConst(classes)) {
|
||||
QString xml = qDBusGenerateClassDefXml(&cdef);
|
||||
output.write(xml.toLocal8Bit());
|
||||
output.write(std::move(xml).toLocal8Bit());
|
||||
}
|
||||
output.write("</node>\n");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue