diff --git a/Userland/Applications/Mail/InboxModel.cpp b/Userland/Applications/Mail/InboxModel.cpp index 750a4bc142..ebc47fac1b 100644 --- a/Userland/Applications/Mail/InboxModel.cpp +++ b/Userland/Applications/Mail/InboxModel.cpp @@ -27,12 +27,12 @@ int InboxModel::row_count(GUI::ModelIndex const&) const ErrorOr InboxModel::column_name(int column_index) const { switch (column_index) { + case Date: + return "Date"_string; case Column::From: return "From"_string; case Subject: return "Subject"_string; - case Date: - return "Date"_string; default: VERIFY_NOT_REACHED(); } @@ -42,12 +42,12 @@ GUI::Variant InboxModel::data(GUI::ModelIndex const& index, GUI::ModelRole role) { auto& value = m_entries[index.row()]; if (role == GUI::ModelRole::Display) { + if (index.column() == Column::Date) + return value.date; if (index.column() == Column::From) return value.from; if (index.column() == Column::Subject) return value.subject; - if (index.column() == Column::Date) - return value.date; } if (role == GUI::ModelRole::TextAlignment) { if (index.column() == Column::Date) diff --git a/Userland/Applications/Mail/InboxModel.h b/Userland/Applications/Mail/InboxModel.h index 62e862c463..91a4899f73 100644 --- a/Userland/Applications/Mail/InboxModel.h +++ b/Userland/Applications/Mail/InboxModel.h @@ -12,9 +12,9 @@ struct InboxEntry { u32 sequence_number; + DeprecatedString date; DeprecatedString from; DeprecatedString subject; - DeprecatedString date; bool seen; }; @@ -26,9 +26,9 @@ enum class InboxModelCustomRole { class InboxModel final : public GUI::Model { public: enum Column { + Date, From, Subject, - Date, __Count }; diff --git a/Userland/Applications/Mail/MailWidget.cpp b/Userland/Applications/Mail/MailWidget.cpp index 902803b5b1..500016a44d 100644 --- a/Userland/Applications/Mail/MailWidget.cpp +++ b/Userland/Applications/Mail/MailWidget.cpp @@ -407,7 +407,7 @@ void MailWidget::selected_mailbox() if (from.is_empty()) from = "(Unknown sender)"; - InboxEntry inbox_entry { sequence_number, from, subject, date, seen }; + InboxEntry inbox_entry { sequence_number, date, from, subject, seen }; m_statusbar->set_text(String::formatted("[{}]: Loading entry {}", mailbox.name, ++i).release_value_but_fixme_should_propagate_errors()); active_inbox_entries.append(inbox_entry);