aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/NyaaSi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/NyaaSi.cpp')
-rw-r--r--src/plugins/NyaaSi.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp
index ccf027d..8e55e62 100644
--- a/src/plugins/NyaaSi.cpp
+++ b/src/plugins/NyaaSi.cpp
@@ -134,12 +134,12 @@ namespace QuickMedia {
return body_item;
}
- static void sort_page_create_body_items(BodyItems &body_items, NyaaSiSortType sort_type) {
+ static void sort_page_create_body_items(Body *body, NyaaSiSortType sort_type) {
for(size_t i = 0; i < sort_type_names.size(); ++i) {
std::string prefix = " ";
if((NyaaSiSortType)i == sort_type)
prefix = "* ";
- body_items.push_back(create_sort_body_item(prefix + sort_type_names[i], (NyaaSiSortType)i));
+ body->append_item(create_sort_body_item(prefix + sort_type_names[i], (NyaaSiSortType)i));
}
}
@@ -294,12 +294,12 @@ namespace QuickMedia {
auto search_page = std::make_unique<NyaaSiSearchPage>(program, strip(title), url, std::move(domain));
NyaaSiSearchPage *search_page_p = search_page.get();
auto body = create_body();
- body->items = std::move(result_items);
+ body->set_items(std::move(result_items));
result_tabs.push_back(Tab{std::move(body), std::move(search_page), create_search_bar("Search...", 500)});
auto sort_order_page_body = create_body();
Body *sort_order_page_body_p = sort_order_page_body.get();
- sort_page_create_body_items(sort_order_page_body->items, NyaaSiSortType::UPLOAD_DATE_DESC);
+ sort_page_create_body_items(sort_order_page_body_p, NyaaSiSortType::UPLOAD_DATE_DESC);
result_tabs.push_back(Tab{std::move(sort_order_page_body), std::make_unique<NyaaSiSortOrderPage>(program, sort_order_page_body_p, search_page_p), nullptr});
return PluginResult::OK;
}
@@ -486,7 +486,7 @@ namespace QuickMedia {
return PluginResult::ERR;
auto body = create_body();
- body->items = std::move(result_items);
+ body->set_items(std::move(result_items));
result_tabs.push_back(Tab{std::move(body), std::make_unique<NyaaSiTorrentPage>(program), nullptr});
return PluginResult::OK;
}
@@ -499,8 +499,8 @@ namespace QuickMedia {
PluginResult NyaaSiSortOrderPage::submit(const std::string&, const std::string&, std::vector<Tab>&) {
const NyaaSiSortType sort_type = (NyaaSiSortType)(size_t)submit_body_item->userdata;
- body->items.clear();
- sort_page_create_body_items(body->items, sort_type);
+ body->clear_items();
+ sort_page_create_body_items(body, sort_type);
search_page->set_sort_type(sort_type);
search_page->needs_refresh = true;
return PluginResult::OK;