From 7113174593f692f691832dbb57e5ed92d9a418c0 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 6 Sep 2019 12:30:50 +0800 Subject: [PATCH] Treat .magnet file extension as case insensitive Closes #11200. --- src/base/filesystemwatcher.cpp | 2 +- src/base/scanfoldersmodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/filesystemwatcher.cpp b/src/base/filesystemwatcher.cpp index c9cbe8c36..f1a0e333e 100644 --- a/src/base/filesystemwatcher.cpp +++ b/src/base/filesystemwatcher.cpp @@ -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; diff --git a/src/base/scanfoldersmodel.cpp b/src/base/scanfoldersmodel.cpp index ffb3bfb3a..17f7ddea0 100644 --- a/src/base/scanfoldersmodel.cpp +++ b/src/base/scanfoldersmodel.cpp @@ -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);