Improve torrent initialization

Don't post "torrent resumed" event when torrent starts in "resumed"
state.
Fix confusing names. Now "resumed torrent" means "unpaused torrent"
only. When we load previously added torrent it is called "restored
torrent".
This commit is contained in:
Vladimir Golovnev (Glassez)
2018-07-11 15:44:15 +03:00
parent 7ebd63a60f
commit cd44ab2fc6
4 changed files with 109 additions and 98 deletions

View File

@@ -138,7 +138,7 @@ namespace BitTorrent
class Tracker;
class MagnetUri;
class TrackerEntry;
struct AddTorrentData;
struct CreateTorrentParams;
struct TorrentStatusReport
{
@@ -598,7 +598,7 @@ namespace BitTorrent
void enableIPFilter();
void disableIPFilter();
bool addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri,
bool addTorrent_impl(CreateTorrentParams params, const MagnetUri &magnetUri,
TorrentInfo torrentInfo = TorrentInfo(),
const QByteArray &fastresumeData = QByteArray());
bool findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) const;
@@ -758,7 +758,7 @@ namespace BitTorrent
QHash<InfoHash, TorrentInfo> m_loadedMetadata;
QHash<InfoHash, TorrentHandle *> m_torrents;
QHash<InfoHash, AddTorrentData> m_addingTorrents;
QHash<InfoHash, CreateTorrentParams> m_addingTorrents;
QHash<QString, AddTorrentParams> m_downloadedTorrents;
QHash<InfoHash, RemovingTorrentData> m_removingTorrents;
TorrentStatusReport m_torrentStatusReport;