diff options
author | ConfuSomu | 2023-04-06 15:57:55 -0400 |
---|---|---|
committer | ConfuSomu | 2023-04-06 16:25:54 -0400 |
commit | 75a48db1459d4c386b867ae6536ff481adf34f1f (patch) | |
tree | 3e3b090ee3b27952bca36104137df628f13a2957 /src/list_item.cpp | |
parent | 3095e11bfaba99fe4fb598a53914b80979aafe0f (diff) | |
download | ActorViewer-75a48db1459d4c386b867ae6536ff481adf34f1f.tar ActorViewer-75a48db1459d4c386b867ae6536ff481adf34f1f.tar.gz ActorViewer-75a48db1459d4c386b867ae6536ff481adf34f1f.zip |
Move call to get status HTML info into ListItem
This makes the code less of a mess and will allow moving more of the
code that renders HTML status info into the ListItem class.
Diffstat (limited to 'src/list_item.cpp')
-rw-r--r-- | src/list_item.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/list_item.cpp b/src/list_item.cpp index b7ee578..6f27ff0 100644 --- a/src/list_item.cpp +++ b/src/list_item.cpp @@ -1,5 +1,4 @@ #include "list_item.h" -#include "types.h" QIcon* choose_icon(StatusType status_type) { // via the use of `static' in the following switch block, the idea is to only initialize each QIcon type once in the program's lifetime. @@ -12,8 +11,8 @@ QIcon* choose_icon(StatusType status_type) { } } -ListItem::ListItem(const QString &text, StatusType status_type, bool has_attachement, QListWidget *parent, int index) : - status_index(index), has_attachement(has_attachement), status_type(status_type) +ListItem::ListItem(const QString &text, StatusType status_type, bool has_attachement, Archive* data_archive, QListWidget *parent, int index) : + status_index(index), has_attachement(has_attachement), status_type(status_type), data_archive(data_archive) { setText(text); setIcon(*choose_icon(status_type)); @@ -39,3 +38,7 @@ int ListItem::get_status_index() { StatusType ListItem::get_status_type() { return status_type; } + +QString ListItem::get_info_html(int text_zone_width, QLocale* locale) { + return data_archive->get_html_status_info(status_index, text_zone_width, status_type, locale); +} |