Explicitly reject opened Add torrent dialogs when exiting app

PR #22535.
Closes #19933.
Supercedes #22533.
This commit is contained in:
Vladimir Golovnev
2025-04-14 09:51:59 +03:00
committed by Vladimir Golovnev (Glassez)
parent de1cf208ce
commit 009cc71f9b
4 changed files with 24 additions and 7 deletions

View File

@@ -82,6 +82,15 @@ GUIAddTorrentManager::GUIAddTorrentManager(IGUIApplication *app, BitTorrent::Ses
connect(btSession(), &BitTorrent::Session::metadataDownloaded, this, &GUIAddTorrentManager::onMetadataDownloaded);
}
GUIAddTorrentManager::~GUIAddTorrentManager()
{
for (AddNewTorrentDialog *dialog : asConst(m_dialogs))
{
dialog->disconnect(this);
dialog->reject();
}
}
bool GUIAddTorrentManager::addTorrent(const QString &source, const BitTorrent::AddTorrentParams &params, const AddTorrentOption option)
{
// `source`: .torrent file path, magnet URI or URL