mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -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
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue