Use qUtf8Printable() for logging strings

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().
This commit is contained in:
Vladimir Golovnev (qlassez) 2017-08-13 13:56:03 +03:00
parent 219a6b3ad1
commit cff6a64e9f
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
28 changed files with 100 additions and 99 deletions

View file

@ -99,9 +99,9 @@ void ProgramUpdater::rssDownloadFinished(const QString &url, const QByteArray &d
else if (xml.isEndElement()) {
if (inItem && xml.name() == "item") {
if (type.compare(OS_TYPE, Qt::CaseInsensitive) == 0) {
qDebug("The last update available is %s", qPrintable(version));
qDebug("The last update available is %s", qUtf8Printable(version));
if (!version.isEmpty()) {
qDebug("Detected version is %s", qPrintable(version));
qDebug("Detected version is %s", qUtf8Printable(version));
if (isVersionMoreRecent(version))
m_updateUrl = updateLink;
}