m_downloader.update();
}
-void
-AddonManager::abort_install()
-{
- log_info << "addon install aborted" << std::endl;
-
- m_downloader.abort(m_transfer_status->id);
-
- m_transfer_status = {};
-}
-
/* EOF */
Addon& get_installed_addon(const AddonId& addon);
TransferStatusPtr request_install_addon(const AddonId& addon_id);
- void abort_install();
void install_addon(const AddonId& addon_id);
void uninstall_addon(const AddonId& addon_id);
} // namespace
void
+TransferStatus::abort()
+{
+ m_downloader.abort(id);
+}
+
+void
TransferStatus::update()
{
m_downloader.update();
}
else
{
+ TransferStatusPtr status = (*it)->get_status();
+
curl_multi_remove_handle(m_multi_handle, (*it)->get_curl_handle());
m_transfers.erase(it);
+
+ for(auto& callback : status->callbacks)
+ {
+ try
+ {
+ callback(false);
+ }
+ catch(const std::exception& err)
+ {
+ log_warning << "Illegal exception in Downloader: " << err.what() << std::endl;
+ }
+ }
}
}
error_msg()
{}
+ void abort();
void update();
void then(const std::function<void (bool)>& callback)
void
DownloadDialog::on_abort()
{
- AddonManager::current()->abort_install();
+ m_status->abort();
}
void