aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Fourchan.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-07 01:01:28 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-07 14:24:32 +0100
commitede1a8476acd54941c20b809455ba62b30302a4e (patch)
tree82160da56025e47484c23e8496f1d59b8ddc084f /src/plugins/Fourchan.cpp
parent8025d1075db0779bde635148f6e38303eb29d6c8 (diff)
Add option to limit number of lines of text drawn in Text class
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r--src/plugins/Fourchan.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index 051acc3..4cfaeaa 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -527,20 +527,9 @@ namespace QuickMedia {
title_text.back() = ' ';
std::string comment_text = html_to_text(comment_begin, comment_end - comment_begin, comment_by_postno, result_items, 0);
- // TODO: Do the same when wrapping is implemented
- // TODO: Remove this
- int num_lines = 0;
- for(size_t i = 0; i < comment_text.size(); ++i) {
- if(comment_text[i] == '\n') {
- ++num_lines;
- if(num_lines == 6) {
- comment_text = comment_text.substr(0, i) + " (...)";
- break;
- }
- }
- }
auto body_item = BodyItem::create(std::move(comment_text));
+ body_item->set_title_max_lines(6);
body_item->set_author(std::move(title_text));
body_item->url = std::to_string(thread_num.asInt64());