TorrentState state;
state.hash = Hash2QStr(handle.hash());
- state.is_new = false;
+ state.action = TorrentState::action_update;
state.state = handle.state();
state.progress = handle.progress() * torrent_progress_max;
state.down_rate = handle.downloadRate();
state.hash = hash;
state.name = handle->name();
- state.is_new = true;
+ state.action = TorrentState::action_add;
state.state = handle->state();
state.progress = handle->progress() * torrent_progress_max;
state.down_rate = handle->downloadRate();
state.hash = hash;
state.name = handle->name();
- state.is_new = true;
+ state.action = TorrentState::action_add;
state.state = handle->state();
state.progress = handle->progress() * torrent_progress_max;
state.down_rate = handle->downloadRate();
void TorrentSession::removeTorrent(const QString &hash)
{
torrents_t::iterator p = torrents_.find(hash);
+
if (p == torrents_.end()) {
qDebug() << "Invalid request to remove torrent with hash " << hash;
return;
"exception catched"
;
}
+
+ TorrentState state;
+ state.hash = hash;
+ state.action = TorrentState::action_remove;
+ emit alert(state, ParamsMap_t());
+ torrents_.erase(p);
}