From d76adff81dd26b4bc9b99e8f269df7908d14c5b1 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 29 Sep 2019 09:47:06 +0800 Subject: [PATCH] Change Session::deleteTorrent() first parameter to take InfoHash type --- src/base/bittorrent/session.cpp | 2 +- src/base/bittorrent/session.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 707d2ef8f..7e3866031 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1625,7 +1625,7 @@ void Session::banIP(const QString &ip) // Delete a torrent from the session, given its hash // and from the disk, if the corresponding deleteOption is chosen -bool Session::deleteTorrent(const QString &hash, const DeleteOption deleteOption) +bool Session::deleteTorrent(const InfoHash &hash, const DeleteOption deleteOption) { TorrentHandle *const torrent = m_torrents.take(hash); if (!torrent) return false; diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index 7324ea812..1dfbbfa42 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -407,7 +407,7 @@ namespace BitTorrent bool isKnownTorrent(const InfoHash &hash) const; bool addTorrent(const QString &source, const AddTorrentParams ¶ms = AddTorrentParams()); bool addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams ¶ms = AddTorrentParams()); - bool deleteTorrent(const QString &hash, DeleteOption deleteOption = Torrent); + bool deleteTorrent(const InfoHash &hash, DeleteOption deleteOption = Torrent); bool loadMetadata(const MagnetUri &magnetUri); bool cancelLoadMetadata(const InfoHash &hash);