Skip to content

Commit e5cecd0

Browse files
committed
Don't follow symlink when creating torrents
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.
1 parent 2d1c4fc commit e5cecd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/base/bittorrent/torrentcreator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void TorrentCreator::run()
123123
// need to sort the file names by natural sort order
124124
QStringList dirs = {m_params.sourcePath.data()};
125125

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

141-
QDirIterator fileIter {dir, QDir::Files};
141+
QDirIterator fileIter {dir, (QDir::Files | QDir::NoSymLinks)};
142142
while (fileIter.hasNext())
143143
{
144144
const QFileInfo fileInfo = fileIter.nextFileInfo();

0 commit comments

Comments
 (0)