Browse Source

Merge pull request #2644 from birdie-github/patch-2

Let's check if the torrent file can actually be opened before passing it...
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
a3d6371d36
  1. 6
      src/gui/addnewtorrentdialog.cpp

6
src/gui/addnewtorrentdialog.cpp

@ -177,6 +177,12 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path) @@ -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…
Cancel
Save