X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Faddon%2Faddon_manager.hpp;h=3dfe843338c93a0bc8e37ab24e98e4be403ca57d;hb=74773542651d1f9dd3ee8fc78a7fbf0e0ac3fe10;hp=713d70db449873cf4d67f19c742b2eccd7ce15ee;hpb=f30bc1786951b8be5c3888c87e5eae00f3b136a5;p=supertux.git diff --git a/src/addon/addon_manager.hpp b/src/addon/addon_manager.hpp index 713d70db4..3dfe84333 100644 --- a/src/addon/addon_manager.hpp +++ b/src/addon/addon_manager.hpp @@ -31,6 +31,8 @@ class Addon; class AddonRepository; +class TransferStatus; +using TransferStatusPtr = std::shared_ptr; typedef std::string AddonId; @@ -38,26 +40,6 @@ typedef std::string AddonId; class AddonManager : public Currenton { public: - struct InstallStatus - { - InstallStatus() : - now(0), - total(0), - done(false), - callback() - {} - - int now; - int total; - bool done; - std::function callback; - - void then(const std::function& callback_) - { - callback = callback_; - } - }; - struct InstallRequest { InstallRequest() : @@ -69,7 +51,6 @@ public: std::string install_filename; }; - using InstallStatusPtr = std::shared_ptr; using InstallRequestPtr = std::shared_ptr; private: @@ -86,7 +67,6 @@ private: bool m_has_been_updated; InstallRequestPtr m_install_request; - InstallStatusPtr m_install_status; TransferStatusPtr m_transfer_status; public: @@ -97,7 +77,7 @@ public: bool has_online_support() const; bool has_been_updated() const; void check_online(); - InstallStatusPtr request_check_online(); + TransferStatusPtr request_check_online(); std::vector get_repository_addons() const; std::vector get_installed_addons() const; @@ -105,7 +85,7 @@ public: Addon& get_repository_addon(const AddonId& addon); Addon& get_installed_addon(const AddonId& addon); - InstallStatusPtr request_install_addon(const AddonId& addon_id); + 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);