mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 10:37:06 -07:00
Ensure file name is valid when exporting torrents
Closes #19275. Closes #19329. PR #19403.
This commit is contained in:
parent
c4ed40b82f
commit
a427b9228d
1 changed files with 2 additions and 1 deletions
|
@ -818,7 +818,8 @@ void TransferListWidget::exportTorrent()
|
|||
bool hasError = false;
|
||||
for (const BitTorrent::Torrent *torrent : torrents)
|
||||
{
|
||||
const Path filePath = savePath / Path(torrent->name() + u".torrent");
|
||||
const QString validName = Utils::Fs::toValidFileName(torrent->name(), u"_"_s);
|
||||
const Path filePath = savePath / Path(validName + u".torrent");
|
||||
if (filePath.exists())
|
||||
{
|
||||
LogMsg(errorMsg.arg(torrent->name(), filePath.toString(), tr("A file with the same name already exists")) , Log::WARNING);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue