mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06: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:
@@ -476,7 +476,7 @@ void AddNewTorrentDialog::renameSelectedFile()
|
||||
const QString newFilePath = oldFilePath.leftRef(oldFilePath.size() - oldFileName.size()) + newName;
|
||||
|
||||
if (oldFileName == newName) {
|
||||
qDebug("Name did not change: %s", qPrintable(oldFileName));
|
||||
qDebug("Name did not change: %s", qUtf8Printable(oldFileName));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ void AddNewTorrentDialog::renameSelectedFile()
|
||||
}
|
||||
}
|
||||
|
||||
qDebug("Renaming %s to %s", qPrintable(oldFilePath), qPrintable(newFilePath));
|
||||
qDebug("Renaming %s to %s", qUtf8Printable(oldFilePath), qUtf8Printable(newFilePath));
|
||||
m_torrentInfo.renameFile(fileIndex, newFilePath);
|
||||
|
||||
m_contentModel->setData(modelIndex, newName);
|
||||
@@ -535,7 +535,7 @@ void AddNewTorrentDialog::renameSelectedFile()
|
||||
QString newName = currentName;
|
||||
newName.replace(0, oldPath.length(), newPath);
|
||||
newName = Utils::Fs::expandPath(newName);
|
||||
qDebug("Rename %s to %s", qPrintable(currentName), qPrintable(newName));
|
||||
qDebug("Rename %s to %s", qUtf8Printable(currentName), qUtf8Printable(newName));
|
||||
m_torrentInfo.renameFile(i, newName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user