Allow to load TorrentInfo from data buffer

This commit is contained in:
Vladimir Golovnev (Glassez) 2017-12-13 17:20:55 +03:00
commit 69df8174b9
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
3 changed files with 21 additions and 12 deletions

View file

@ -286,7 +286,7 @@ bool AddNewTorrentDialog::loadTorrent(const QString &torrentPath)
m_hasMetadata = true;
QString error;
m_torrentInfo = BitTorrent::TorrentInfo::loadFromFile(m_filePath, error);
m_torrentInfo = BitTorrent::TorrentInfo::loadFromFile(m_filePath, &error);
if (!m_torrentInfo.isValid()) {
MessageBoxRaised::critical(this, tr("Invalid torrent"), tr("Failed to load the torrent: %1.\nError: %2", "Don't remove the '\n' characters. They insert a newline.").arg(Utils::Fs::toNativePath(m_filePath)).arg(error));
return false;