restricted SPAM/STAR/TAGS to inbox, and made msg summary list refer to current box only

This commit is contained in:
csoler 2023-09-23 17:53:12 +02:00
parent 41069a0fa5
commit a99f686fd1
3 changed files with 9 additions and 4 deletions

View File

@ -690,6 +690,10 @@ void RsMessageModel::setCurrentBox(Rs::Msgs::BoxName bn)
}
}
Rs::Msgs::BoxName RsMessageModel::currentBox() const
{
return mCurrentBox;
}
void RsMessageModel::setQuickViewFilter(QuickViewFilter fn)
{
if(fn != mQuickViewFilter)

View File

@ -100,6 +100,7 @@ public:
// This method will asynchroneously update the data
void setCurrentBox(Rs::Msgs::BoxName bn) ;
Rs::Msgs::BoxName currentBox() const ;
void setQuickViewFilter(QuickViewFilter fn) ;
void setFilter(FilterType filter_type, const QStringList& strings) ;

View File

@ -925,9 +925,9 @@ void MessagesDialog::changeBox(int box_row)
ui.messageTreeWidget->setPlaceholderText(placeholderText);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_READ,box_row!=ROW_INBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_STAR,box_row==ROW_OUTBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_SPAM,box_row==ROW_OUTBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_TAGS,box_row==ROW_OUTBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_STAR,box_row!=ROW_INBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_SPAM,box_row!=ROW_INBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_TAGS,box_row!=ROW_INBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_MSGID,true);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_CONTENT,true);
}
@ -1296,7 +1296,7 @@ void MessagesDialog::updateMessageSummaryList()
/* calculating the new messages */
std::list<MsgInfoSummary> msgList;
rsMail->getMessageSummaries(Rs::Msgs::BoxName::BOX_ALL,msgList);
rsMail->getMessageSummaries(mMessageModel->currentBox(),msgList);
QMap<int, int> tagCount;