Skip to content

Commit

Permalink
Treat .magnet file extension as case insensitive
Browse files Browse the repository at this point in the history
Closes #11200.
  • Loading branch information
Chocobo1 committed Sep 6, 2019
1 parent ee0f38a commit 7113174
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 7113174

Please sign in to comment.