From 75c610d1f65d741bbeba9f1ddeef60a6e9315427 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 Feb 2022 22:54:20 +0100 Subject: Use one struct for all args in Page::submit instead of multiple args (easier to add new fields without changing code) Also remove submit_body_item from page. --- plugins/MyAnimeList.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/MyAnimeList.hpp') diff --git a/plugins/MyAnimeList.hpp b/plugins/MyAnimeList.hpp index 192f0f3..8f35043 100644 --- a/plugins/MyAnimeList.hpp +++ b/plugins/MyAnimeList.hpp @@ -10,7 +10,7 @@ namespace QuickMedia { bool search_is_filter() override { return false; } bool submit_is_async() const override { return false; } SearchResult search(const std::string &str, BodyItems &result_items) override; - PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; + PluginResult submit(const SubmitArgs &args, std::vector &result_tabs) override; }; class MyAnimeListDetailsPage : public LazyFetchPage { @@ -18,7 +18,7 @@ namespace QuickMedia { MyAnimeListDetailsPage(Program *program, std::string url) : LazyFetchPage(program), url(std::move(url)) {} const char* get_title() const override { return "Details"; } bool submit_is_async() const override { return false; } - PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; + PluginResult submit(const SubmitArgs &args, std::vector &result_tabs) override; PluginResult lazy_fetch(BodyItems &result_items) override; private: std::string url; @@ -29,7 +29,7 @@ namespace QuickMedia { MyAnimeListRecommendationsPage(Program *program, std::string url) : LazyFetchPage(program), url(std::move(url)) {} const char* get_title() const override { return "Recommendations"; } bool submit_is_async() const override { return false; } - PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; + PluginResult submit(const SubmitArgs &args, std::vector &result_tabs) override; PluginResult lazy_fetch(BodyItems &result_items) override; private: std::string url; -- cgit v1.2.3