From e1a8d10b61c5f8ca092ba3aa458b661da29ba447 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 30 Sep 2020 19:07:05 +0200 Subject: Matrix: add message replying with ctrl+r, also use shared_ptr for BodyItem --- src/plugins/Mangatown.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/Mangatown.cpp') diff --git a/src/plugins/Mangatown.cpp b/src/plugins/Mangatown.cpp index 67f4c29..0964310 100644 --- a/src/plugins/Mangatown.cpp +++ b/src/plugins/Mangatown.cpp @@ -22,7 +22,7 @@ namespace QuickMedia { const char *href = quickmedia_html_node_get_attribute_value(node, "href"); const char *text = quickmedia_html_node_get_text(node); if(href && text && strncmp(href, "/manga/", 7) == 0) { - auto item = std::make_unique(strip(text)); + auto item = BodyItem::create(strip(text)); item->url = mangatown_url + href; item_data->push_back(std::move(item)); } @@ -76,10 +76,10 @@ namespace QuickMedia { for(const Json::Value &child : json_suggestions) { if(!child.isString()) { - result_items.push_back(std::make_unique("")); + result_items.push_back(BodyItem::create("")); continue; } - result_items.push_back(std::make_unique(child.asString())); + result_items.push_back(BodyItem::create(child.asString())); } size_t index = 0; @@ -88,7 +88,7 @@ namespace QuickMedia { if(index < result_items.size()) { body_item = result_items[index].get(); } else { - result_items.push_back(std::make_unique("")); + result_items.push_back(BodyItem::create("")); body_item = result_items.back().get(); } @@ -123,7 +123,7 @@ namespace QuickMedia { const char *href = quickmedia_html_node_get_attribute_value(node, "href"); const char *title = quickmedia_html_node_get_attribute_value(node, "title"); if(href && title && strncmp(href, "/manga/", 7) == 0) { - auto item = std::make_unique(strip(title)); + auto item = BodyItem::create(strip(title)); item->url = mangatown_url + href; item_data->push_back(std::move(item)); } -- cgit v1.2.3