mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Improve "info hash" handling
Define "torrent ID" concept, which is either a SHA1 hash for torrents of version 1, or a SHA256 hash (truncated to SHA1 hash length) for torrents of version 2. Add support for native libtorrent2 info hashes.
This commit is contained in:
parent
4da4fb0676
commit
561b597031
34 changed files with 463 additions and 320 deletions
|
@ -958,7 +958,7 @@ void MainWindow::askRecursiveTorrentDownloadConfirmation(BitTorrent::Torrent *co
|
|||
Preferences *const pref = Preferences::instance();
|
||||
if (pref->recursiveDownloadDisabled()) return;
|
||||
|
||||
const auto torrentHash = torrent->hash();
|
||||
const auto torrentID = torrent->id();
|
||||
|
||||
QMessageBox *confirmBox = new QMessageBox(QMessageBox::Question, tr("Recursive download confirmation")
|
||||
, tr("The torrent '%1' contains torrent files, do you want to proceed with their download?").arg(torrent->name())
|
||||
|
@ -969,10 +969,10 @@ void MainWindow::askRecursiveTorrentDownloadConfirmation(BitTorrent::Torrent *co
|
|||
const QPushButton *yes = confirmBox->addButton(tr("Yes"), QMessageBox::YesRole);
|
||||
/*QPushButton *no = */ confirmBox->addButton(tr("No"), QMessageBox::NoRole);
|
||||
const QPushButton *never = confirmBox->addButton(tr("Never"), QMessageBox::NoRole);
|
||||
connect(confirmBox, &QMessageBox::buttonClicked, this, [torrentHash, yes, never](const QAbstractButton *button)
|
||||
connect(confirmBox, &QMessageBox::buttonClicked, this, [torrentID, yes, never](const QAbstractButton *button)
|
||||
{
|
||||
if (button == yes)
|
||||
BitTorrent::Session::instance()->recursiveTorrentDownload(torrentHash);
|
||||
BitTorrent::Session::instance()->recursiveTorrentDownload(torrentID);
|
||||
if (button == never)
|
||||
Preferences::instance()->disableRecursiveDownload();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue