mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
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:
parent
219a6b3ad1
commit
cff6a64e9f
28 changed files with 100 additions and 99 deletions
|
@ -554,7 +554,7 @@ bool Application::event(QEvent *ev)
|
|||
if (path.isEmpty())
|
||||
// Get the url instead
|
||||
path = static_cast<QFileOpenEvent *>(ev)->url().toString();
|
||||
qDebug("Received a mac file open event: %s", qPrintable(path));
|
||||
qDebug("Received a mac file open event: %s", qUtf8Printable(path));
|
||||
if (m_running)
|
||||
processParams(QStringList(path));
|
||||
else
|
||||
|
@ -589,16 +589,16 @@ void Application::initializeTranslation()
|
|||
|
||||
if (m_qtTranslator.load(QString::fromUtf8("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load(QString::fromUtf8("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
qDebug("Qt %s locale recognized, using translation.", qPrintable(localeStr));
|
||||
qDebug("Qt %s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("Qt %s locale unrecognized, using default (en).", qPrintable(localeStr));
|
||||
qDebug("Qt %s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
|
||||
installTranslator(&m_qtTranslator);
|
||||
|
||||
if (m_translator.load(QString::fromUtf8(":/lang/qbittorrent_") + localeStr))
|
||||
qDebug("%s locale recognized, using translation.", qPrintable(localeStr));
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("%s locale unrecognized, using default (en).", qPrintable(localeStr));
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
installTranslator(&m_translator);
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue