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
committed by sledgehammer999
parent 0b6cf54508
commit 8fc931a61b
28 changed files with 100 additions and 99 deletions

View File

@@ -476,9 +476,9 @@ void OptionsDialog::saveOptions()
if (pref->getLocale() != locale) {
QTranslator *translator = new QTranslator;
if (translator->load(QString::fromUtf8(":/lang/qbittorrent_") + locale))
qDebug("%s locale recognized, using translation.", qPrintable(locale));
qDebug("%s locale recognized, using translation.", qUtf8Printable(locale));
else
qDebug("%s locale unrecognized, using default (en).", qPrintable(locale));
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(locale));
qApp->installTranslator(translator);
}