Assign add_torrent_alert handler when adding torrent

This commit is contained in:
Vladimir Golovnev (Glassez)
2025-04-20 20:21:04 +03:00
parent 582dc99cae
commit 9afbd47b52
3 changed files with 110 additions and 91 deletions

View File

@@ -30,6 +30,7 @@
#pragma once
#include <chrono>
#include <functional>
#include <utility>
#include <vector>
@@ -44,6 +45,7 @@
#include <QMap>
#include <QMutex>
#include <QPointer>
#include <QQueue>
#include <QSet>
#include <QThreadPool>
@@ -815,6 +817,9 @@ namespace BitTorrent
FileSearcher *m_fileSearcher = nullptr;
TorrentContentRemover *m_torrentContentRemover = nullptr;
using AddTorrentAlertHandler = std::function<void (const lt::add_torrent_alert *alert)>;
QQueue<AddTorrentAlertHandler> m_addTorrentAlertHandlers;
QHash<TorrentID, lt::torrent_handle> m_downloadedMetadata;
QHash<TorrentID, TorrentImpl *> m_torrents;