diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-04 10:15:06 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-04 10:15:06 +0200 |
commit | e38f78faf5c0f70486fbd75874cdba685596246e (patch) | |
tree | 33815c3482bb9f1043f2e10853128146f10f267a /Applications/ChanViewer | |
parent | 030891531b9a0626502e6e2bbb9cd5dc6eb56d68 (diff) | |
download | serenity-e38f78faf5c0f70486fbd75874cdba685596246e.zip |
ChanViewer: Show the time of each post in the thread catalog
Diffstat (limited to 'Applications/ChanViewer')
-rw-r--r-- | Applications/ChanViewer/ThreadCatalogModel.cpp | 8 | ||||
-rw-r--r-- | Applications/ChanViewer/ThreadCatalogModel.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Applications/ChanViewer/ThreadCatalogModel.cpp b/Applications/ChanViewer/ThreadCatalogModel.cpp index 5d3334507b..e3245b571e 100644 --- a/Applications/ChanViewer/ThreadCatalogModel.cpp +++ b/Applications/ChanViewer/ThreadCatalogModel.cpp @@ -68,6 +68,8 @@ String ThreadCatalogModel::column_name(int column) const return "Replies"; case Column::ImageCount: return "Images"; + case Column::PostTime: + return "Time"; default: ASSERT_NOT_REACHED(); } @@ -79,11 +81,13 @@ GModel::ColumnMetadata ThreadCatalogModel::column_metadata(int column) const case Column::ThreadNumber: return { 70, TextAlignment::CenterRight }; case Column::Text: - return { 200, TextAlignment::CenterLeft }; + return { 290, TextAlignment::CenterLeft }; case Column::ReplyCount: return { 45, TextAlignment::CenterRight }; case Column::ImageCount: return { 40, TextAlignment::CenterRight }; + case Column::PostTime: + return { 120, TextAlignment::CenterLeft }; default: ASSERT_NOT_REACHED(); } @@ -102,6 +106,8 @@ GVariant ThreadCatalogModel::data(const GModelIndex& index, Role role) const return thread.get("replies").to_u32(); case Column::ImageCount: return thread.get("images").to_u32(); + case Column::PostTime: + return thread.get("now").to_string(); default: ASSERT_NOT_REACHED(); } diff --git a/Applications/ChanViewer/ThreadCatalogModel.h b/Applications/ChanViewer/ThreadCatalogModel.h index ce1e30fbeb..1e94b9db48 100644 --- a/Applications/ChanViewer/ThreadCatalogModel.h +++ b/Applications/ChanViewer/ThreadCatalogModel.h @@ -10,6 +10,7 @@ public: Text, ReplyCount, ImageCount, + PostTime, __Count, }; |