mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Let's check if the torrent file can actually be opened before passing it to libtorrent
If we don't have enough permissions, libtorrent will spew a pretty useless, irrelevant and almost wrong message: "Failed to load the torrent: torrent file is not a dictionary"
This commit is contained in:
parent
19b9a84576
commit
4f8155e612
1 changed files with 6 additions and 0 deletions
|
@ -190,6 +190,12 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString
|
|||
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;
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue