Use uniform way to export .torrent files

PR #17013.
This commit is contained in:
Vladimir Golovnev
2022-05-10 15:36:05 +03:00
committed by GitHub
parent 5af78ad2cd
commit a048ea668f
3 changed files with 9 additions and 31 deletions

View File

@@ -2269,7 +2269,7 @@ nonstd::expected<lt::entry, QString> TorrentImpl::exportTorrent() const
{
#ifdef QBT_USES_LIBTORRENT2
const std::shared_ptr<lt::torrent_info> completeTorrentInfo = m_nativeHandle.torrent_file_with_hashes();
const std::shared_ptr<lt::torrent_info> torrentInfo = {completeTorrentInfo ? completeTorrentInfo : info().nativeInfo()};
const std::shared_ptr<lt::torrent_info> torrentInfo = (completeTorrentInfo ? completeTorrentInfo : info().nativeInfo());
#else
const std::shared_ptr<lt::torrent_info> torrentInfo = info().nativeInfo();
#endif