Skip to content

Commit 6a3b0ed

Browse files
author
Martin Rotter
committed
fix #507 for good - note that there was some very common code changed, feared of regressions, hopefully, they will not be there
1 parent 8890f37 commit 6a3b0ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librssguard/gui/messagesview.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ void MessagesView::keyboardSearch(const QString& search) {
147147
void MessagesView::reloadSelections() {
148148
const QDateTime dt1 = QDateTime::currentDateTime();
149149
QModelIndex current_index = selectionModel()->currentIndex();
150+
const bool is_current_selected = selectionModel()->selectedRows().contains(m_proxyModel->index(current_index.row(),
151+
0,
152+
current_index.parent()));
150153
const QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index);
151154
const Message selected_message = m_sourceModel->messageAt(mapped_current_index.row());
152155
const int col = header()->sortIndicatorSection();
@@ -157,7 +160,8 @@ void MessagesView::reloadSelections() {
157160

158161
// Now, we must find the same previously focused message.
159162
if (selected_message.m_id > 0) {
160-
if (m_proxyModel->rowCount() == 0) {
163+
if (m_proxyModel->rowCount() == 0 ||
164+
!is_current_selected) {
161165
current_index = QModelIndex();
162166
}
163167
else {

0 commit comments

Comments
 (0)