Skip to content

Commit

Permalink
Don't follow symlink when creating torrents
Browse files Browse the repository at this point in the history
Now on Windows, it won't follow/include .lnk files when creating torrents.
Note that libtorrent will throw errors if we force adding .lnk files.

Closes #13286.
  • Loading branch information
Chocobo1 committed Dec 3, 2024
1 parent 2d1c4fc commit e5cecd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/base/bittorrent/torrentcreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void TorrentCreator::run()
// need to sort the file names by natural sort order
QStringList dirs = {m_params.sourcePath.data()};

QDirIterator dirIter {m_params.sourcePath.data(), (QDir::AllDirs | QDir::NoDotAndDotDot), QDirIterator::Subdirectories};
QDirIterator dirIter {m_params.sourcePath.data(), (QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks), QDirIterator::Subdirectories};
while (dirIter.hasNext())
{
const QString filePath = dirIter.next();
Expand All @@ -138,7 +138,7 @@ void TorrentCreator::run()
{
QStringList tmpNames; // natural sort files within each dir

QDirIterator fileIter {dir, QDir::Files};
QDirIterator fileIter {dir, (QDir::Files | QDir::NoSymLinks)};
while (fileIter.hasNext())
{
const QFileInfo fileInfo = fileIter.nextFileInfo();
Expand Down

0 comments on commit e5cecd0

Please sign in to comment.