Treat .magnet file extension as case insensitive

Closes #11200.
This commit is contained in:
Chocobo1 2019-09-06 12:30:50 +08:00 committed by sledgehammer999
commit 11ca744548
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
2 changed files with 2 additions and 2 deletions

View file

@ -162,7 +162,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;

View file

@ -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);