forked from premiere/premiere-libtorrent
a bit more robust error messaging when deleting files in a torrent
This commit is contained in:
parent
d52a1f8c0a
commit
8d8d160b35
|
@ -280,7 +280,7 @@ namespace libtorrent
|
|||
|
||||
bool should_check_files() const;
|
||||
|
||||
void delete_files();
|
||||
bool delete_files();
|
||||
|
||||
// ============ start deprecation =============
|
||||
void filter_piece(int index, bool filter);
|
||||
|
|
|
@ -5279,7 +5279,13 @@ retry:
|
|||
|
||||
torrent& t = *i->second;
|
||||
if (options & session::delete_files)
|
||||
t.delete_files();
|
||||
{
|
||||
if (!t.delete_files())
|
||||
{
|
||||
if (alerts().should_post<torrent_delete_failed_alert>())
|
||||
alerts().post_alert(torrent_delete_failed_alert(t.get_handle(), error_code()));
|
||||
}
|
||||
}
|
||||
|
||||
tptr->update_guage();
|
||||
|
||||
|
|
|
@ -6976,7 +6976,7 @@ namespace libtorrent
|
|||
return limit;
|
||||
}
|
||||
|
||||
void torrent::delete_files()
|
||||
bool torrent::delete_files()
|
||||
{
|
||||
TORRENT_ASSERT(m_ses.is_network_thread());
|
||||
|
||||
|
@ -6992,7 +6992,9 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(m_storage);
|
||||
m_storage->async_delete_files(
|
||||
boost::bind(&torrent::on_files_deleted, shared_from_this(), _1, _2));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void torrent::clear_error()
|
||||
|
|
Loading…
Reference in New Issue