Message displaying disabled if messages got removed.
This commit is contained in:
parent
6e7312e3e7
commit
0e83739327
1 changed files with 21 additions and 10 deletions
|
@ -62,19 +62,30 @@ void MessagesView::reloadSelections(int mark_current_index_read) {
|
||||||
current_index = m_proxyModel->mapFromSource(m_sourceModel->index(mapped_current_index.row(),
|
current_index = m_proxyModel->mapFromSource(m_sourceModel->index(mapped_current_index.row(),
|
||||||
mapped_current_index.column()));
|
mapped_current_index.column()));
|
||||||
|
|
||||||
if (mark_current_index_read == 0) {
|
|
||||||
// User selected to mark some messages as unread, if one
|
|
||||||
// of them will be marked as current, then it will be read again.
|
if (current_index.isValid()) {
|
||||||
m_batchUnreadSwitch = true;
|
if (mark_current_index_read == 0) {
|
||||||
setCurrentIndex(current_index);
|
// User selected to mark some messages as unread, if one
|
||||||
m_batchUnreadSwitch = false;
|
// of them will be marked as current, then it will be read again.
|
||||||
|
m_batchUnreadSwitch = true;
|
||||||
|
setCurrentIndex(current_index);
|
||||||
|
m_batchUnreadSwitch = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setCurrentIndex(current_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
scrollTo(current_index);
|
||||||
|
reselectIndexes(selected_indexes);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setCurrentIndex(current_index);
|
// Messages were probably removed from the model, nothing can
|
||||||
|
// be selected and no message can be displayed.
|
||||||
|
// TOTO: Check if this is OKAY. If not, then emit this signal
|
||||||
|
// from FeedsView itself.
|
||||||
|
emit currentMessageRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollTo(current_index);
|
|
||||||
reselectIndexes(selected_indexes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesModel *MessagesView::sourceModel() {
|
MessagesModel *MessagesView::sourceModel() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue