Browse Source

Ensure file name is valid when exporting torrents

Closes #19275.
Closes #19329.
PR #19403.
adaptive-webui-19844
Chocobo1 1 year ago committed by GitHub
parent
commit
a427b9228d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/gui/transferlistwidget.cpp

3
src/gui/transferlistwidget.cpp

@ -818,7 +818,8 @@ void TransferListWidget::exportTorrent() @@ -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…
Cancel
Save