mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
Mail: Make Date the first column
This commit is contained in:
parent
392fcc0ce6
commit
59968c97f0
3 changed files with 7 additions and 7 deletions
|
@ -27,12 +27,12 @@ int InboxModel::row_count(GUI::ModelIndex const&) const
|
||||||
ErrorOr<String> InboxModel::column_name(int column_index) const
|
ErrorOr<String> InboxModel::column_name(int column_index) const
|
||||||
{
|
{
|
||||||
switch (column_index) {
|
switch (column_index) {
|
||||||
|
case Date:
|
||||||
|
return "Date"_string;
|
||||||
case Column::From:
|
case Column::From:
|
||||||
return "From"_string;
|
return "From"_string;
|
||||||
case Subject:
|
case Subject:
|
||||||
return "Subject"_string;
|
return "Subject"_string;
|
||||||
case Date:
|
|
||||||
return "Date"_string;
|
|
||||||
default:
|
default:
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
@ -42,12 +42,12 @@ GUI::Variant InboxModel::data(GUI::ModelIndex const& index, GUI::ModelRole role)
|
||||||
{
|
{
|
||||||
auto& value = m_entries[index.row()];
|
auto& value = m_entries[index.row()];
|
||||||
if (role == GUI::ModelRole::Display) {
|
if (role == GUI::ModelRole::Display) {
|
||||||
|
if (index.column() == Column::Date)
|
||||||
|
return value.date;
|
||||||
if (index.column() == Column::From)
|
if (index.column() == Column::From)
|
||||||
return value.from;
|
return value.from;
|
||||||
if (index.column() == Column::Subject)
|
if (index.column() == Column::Subject)
|
||||||
return value.subject;
|
return value.subject;
|
||||||
if (index.column() == Column::Date)
|
|
||||||
return value.date;
|
|
||||||
}
|
}
|
||||||
if (role == GUI::ModelRole::TextAlignment) {
|
if (role == GUI::ModelRole::TextAlignment) {
|
||||||
if (index.column() == Column::Date)
|
if (index.column() == Column::Date)
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
|
|
||||||
struct InboxEntry {
|
struct InboxEntry {
|
||||||
u32 sequence_number;
|
u32 sequence_number;
|
||||||
|
DeprecatedString date;
|
||||||
DeprecatedString from;
|
DeprecatedString from;
|
||||||
DeprecatedString subject;
|
DeprecatedString subject;
|
||||||
DeprecatedString date;
|
|
||||||
bool seen;
|
bool seen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ enum class InboxModelCustomRole {
|
||||||
class InboxModel final : public GUI::Model {
|
class InboxModel final : public GUI::Model {
|
||||||
public:
|
public:
|
||||||
enum Column {
|
enum Column {
|
||||||
|
Date,
|
||||||
From,
|
From,
|
||||||
Subject,
|
Subject,
|
||||||
Date,
|
|
||||||
__Count
|
__Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -407,7 +407,7 @@ void MailWidget::selected_mailbox()
|
||||||
if (from.is_empty())
|
if (from.is_empty())
|
||||||
from = "(Unknown sender)";
|
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());
|
m_statusbar->set_text(String::formatted("[{}]: Loading entry {}", mailbox.name, ++i).release_value_but_fixme_should_propagate_errors());
|
||||||
|
|
||||||
active_inbox_entries.append(inbox_entry);
|
active_inbox_entries.append(inbox_entry);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue