mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Reuse alert dispatcher
Instead of using a specific alert handler in `SessionImpl::saveResumeData()`, reuse the generic one.
This commit is contained in:
parent
a44bca3f07
commit
c94152c47c
3 changed files with 18 additions and 10 deletions
|
@ -2444,6 +2444,12 @@ void SessionImpl::handleTorrentSaveResumeDataRequested(const TorrentImpl *torren
|
|||
++m_numResumeData;
|
||||
}
|
||||
|
||||
void SessionImpl::handleTorrentSaveResumeDataFailed(const TorrentImpl *torrent)
|
||||
{
|
||||
Q_UNUSED(torrent);
|
||||
--m_numResumeData;
|
||||
}
|
||||
|
||||
QVector<Torrent *> SessionImpl::torrents() const
|
||||
{
|
||||
QVector<Torrent *> result;
|
||||
|
@ -2904,16 +2910,12 @@ void SessionImpl::saveResumeData()
|
|||
bool hasWantedAlert = false;
|
||||
for (const lt::alert *a : alerts)
|
||||
{
|
||||
switch (a->type())
|
||||
if (const int alertType = a->type();
|
||||
(alertType == lt::save_resume_data_alert::alert_type)
|
||||
|| (alertType == lt::save_resume_data_failed_alert::alert_type))
|
||||
{
|
||||
case lt::save_resume_data_failed_alert::alert_type:
|
||||
hasWantedAlert = true;
|
||||
--m_numResumeData;
|
||||
break;
|
||||
case lt::save_resume_data_alert::alert_type:
|
||||
hasWantedAlert = true;
|
||||
dispatchTorrentAlert(static_cast<const lt::torrent_alert *>(a));
|
||||
break;
|
||||
handleAlert(a);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue