mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-13 05:41:17 +00:00
Merge pull request #2644 from birdie-github/patch-2
Let's check if the torrent file can actually be opened before passing it...
This commit is contained in:
commit
a3d6371d36
@ -177,6 +177,12 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path)
|
||||
return false;
|
||||
}
|
||||
|
||||
QFileInfo fileinfo(m_filePath);
|
||||
if (!fileinfo.isReadable()) {
|
||||
MessageBoxRaised::critical(0, tr("I/O Error"), tr("The torrent file cannot be read from the disk. Probably you don't have enough permissions."));
|
||||
return false;
|
||||
}
|
||||
|
||||
m_hasMetadata = true;
|
||||
QString error;
|
||||
m_torrentInfo = BitTorrent::TorrentInfo::loadFromFile(m_filePath, error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user