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

@@ -155,7 +155,7 @@ void SearchEngine::updatePlugin(const QString &name)
// Install or update plugin from file or url
void SearchEngine::installPlugin(const QString &source)
{
qDebug("Asked to install plugin at %s", qPrintable(source));
qDebug("Asked to install plugin at %s", qUtf8Printable(source));
if (Utils::Misc::isUrl(source)) {
using namespace Net;
@@ -615,7 +615,7 @@ void SearchEngine::parseVersionInfo(const QByteArray &info)
dataCorrect = true;
if (isUpdateNeeded(pluginName, version)) {
qDebug("Plugin: %s is outdated", qPrintable(pluginName));
qDebug("Plugin: %s is outdated", qUtf8Printable(pluginName));
updateInfo[pluginName] = version;
}
}
@@ -662,7 +662,7 @@ PluginVersion SearchEngine::getPluginVersion(QString filePath)
{
QFile plugin(filePath);
if (!plugin.exists()) {
qDebug("%s plugin does not exist, returning 0.0", qPrintable(filePath));
qDebug("%s plugin does not exist, returning 0.0", qUtf8Printable(filePath));
return {};
}