File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,9 @@ void MessagesView::keyboardSearch(const QString& search) {
147
147
void MessagesView::reloadSelections () {
148
148
const QDateTime dt1 = QDateTime::currentDateTime ();
149
149
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 ()));
150
153
const QModelIndex mapped_current_index = m_proxyModel->mapToSource (current_index);
151
154
const Message selected_message = m_sourceModel->messageAt (mapped_current_index.row ());
152
155
const int col = header ()->sortIndicatorSection ();
@@ -157,7 +160,8 @@ void MessagesView::reloadSelections() {
157
160
158
161
// Now, we must find the same previously focused message.
159
162
if (selected_message.m_id > 0 ) {
160
- if (m_proxyModel->rowCount () == 0 ) {
163
+ if (m_proxyModel->rowCount () == 0 ||
164
+ !is_current_selected) {
161
165
current_index = QModelIndex ();
162
166
}
163
167
else {
You can’t perform that action at this time.
0 commit comments