From ede1a8476acd54941c20b809455ba62b30302a4e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 Nov 2022 01:01:28 +0100 Subject: Add option to limit number of lines of text drawn in Text class --- src/plugins/Fourchan.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/plugins/Fourchan.cpp') 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()); -- cgit v1.2.3