X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Faddon%2Faddon_manager.hpp;h=fafebb0daf4392a11ee36b627c9ec7325e08dbdf;hb=2b7cf1bf8c85a4df1d2a02ddcad8723b40f8efff;hp=a58f38cee0ea8622cf14effb42c66a238e5361ee;hpb=140e8eab7d0732663de2c1f0a0f2edcc5bc1749f;p=supertux.git diff --git a/src/addon/addon_manager.hpp b/src/addon/addon_manager.hpp index a58f38cee..fafebb0da 100644 --- a/src/addon/addon_manager.hpp +++ b/src/addon/addon_manager.hpp @@ -18,6 +18,7 @@ #ifndef HEADER_SUPERTUX_ADDON_ADDON_MANAGER_HPP #define HEADER_SUPERTUX_ADDON_ADDON_MANAGER_HPP +#include #include #include #include @@ -30,40 +31,14 @@ class Addon; class AddonRepository; +class TransferStatus; +using TransferStatusPtr = std::shared_ptr; typedef std::string AddonId; /** Checks for, installs and removes Add-ons */ class AddonManager : public Currenton { -public: - struct InstallStatus - { - InstallStatus() : - now(0), - total(0), - done(false) - {} - - int now; - int total; - bool done; - }; - - struct InstallRequest - { - InstallRequest() : - addon_id(), - install_filename() - {} - - std::string addon_id; - std::string install_filename; - }; - - using InstallStatusPtr = std::shared_ptr; - using InstallRequestPtr = std::shared_ptr; - private: using AddonList = std::vector >; @@ -77,8 +52,6 @@ private: bool m_has_been_updated; - InstallRequestPtr m_install_request; - InstallStatusPtr m_install_status; TransferStatusPtr m_transfer_status; public: @@ -89,6 +62,7 @@ public: bool has_online_support() const; bool has_been_updated() const; void check_online(); + TransferStatusPtr request_check_online(); std::vector get_repository_addons() const; std::vector get_installed_addons() const; @@ -96,8 +70,7 @@ public: Addon& get_repository_addon(const AddonId& addon); Addon& get_installed_addon(const AddonId& addon); - InstallStatusPtr request_install_addon(const AddonId& addon_id); - void abort_install(); + TransferStatusPtr request_install_addon(const AddonId& addon_id); void install_addon(const AddonId& addon_id); void uninstall_addon(const AddonId& addon_id); @@ -109,7 +82,7 @@ public: private: std::vector scan_for_archives() const; void add_installed_addons(); - AddonList parse_addon_infos(const std::string& addoninfos) const; + AddonList parse_addon_infos(const std::string& filename) const; /** add \a archive, given as physfs path, to the list of installed archives */