Skip to content

Commit

Permalink
Merge pull request #11201 from Chocobo1/watcher
Browse files Browse the repository at this point in the history
Treat .magnet file extension as case insensitive in filesystem watcher
  • Loading branch information
Chocobo1 committed Sep 7, 2019
2 parents f3b4fb8 + 7113174 commit ee8b99f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/base/filesystemwatcher.cpp
Expand Up @@ -160,7 +160,7 @@ void FileSystemWatcher::processTorrentsInDir(const QDir &dir)
const QStringList files = dir.entryList({"*.torrent", "*.magnet"}, QDir::Files);
for (const QString &file : files) {
const QString fileAbsPath = dir.absoluteFilePath(file);
if (file.endsWith(".magnet"))
if (file.endsWith(".magnet", Qt::CaseInsensitive))
torrents << fileAbsPath;
else if (BitTorrent::TorrentInfo::loadFromFile(fileAbsPath).isValid())
torrents << fileAbsPath;
Expand Down
2 changes: 1 addition & 1 deletion src/base/scanfoldersmodel.cpp
Expand Up @@ -360,7 +360,7 @@ void ScanFoldersModel::addTorrentsToSession(const QStringList &pathList)
else if (!downloadInDefaultFolder(file))
params.savePath = downloadPathTorrentFolder(file);

if (file.endsWith(".magnet")) {
if (file.endsWith(".magnet", Qt::CaseInsensitive)) {
QFile f(file);
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream str(&f);
Expand Down

0 comments on commit ee8b99f

Please sign in to comment.