aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Mangatown.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-30 19:07:05 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-30 19:08:05 +0200
commite1a8d10b61c5f8ca092ba3aa458b661da29ba447 (patch)
tree4de5ca75c3d19e4bd4c5c25a4362768b3e994326 /src/plugins/Mangatown.cpp
parent86d228bfc3e9c81c011c31bc81a908a21f975bfb (diff)
Matrix: add message replying with ctrl+r, also use shared_ptr for BodyItem
Diffstat (limited to 'src/plugins/Mangatown.cpp')
-rw-r--r--src/plugins/Mangatown.cpp10
1 files changed, 5 insertions, 5 deletions
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<BodyItem>(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<BodyItem>(""));
+ result_items.push_back(BodyItem::create(""));
continue;
}
- result_items.push_back(std::make_unique<BodyItem>(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<BodyItem>(""));
+ 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<BodyItem>(strip(title));
+ auto item = BodyItem::create(strip(title));
item->url = mangatown_url + href;
item_data->push_back(std::move(item));
}