do not force reload list of messages after msg sync is done if there is some message selected
This commit is contained in:
parent
adeb9752fe
commit
95e9279192
@ -396,7 +396,7 @@ void FormMain::onFeedUpdatesFinished(const FeedDownloadResults& results) {
|
|||||||
Q_UNUSED(results)
|
Q_UNUSED(results)
|
||||||
|
|
||||||
statusBar()->clearProgressFeeds();
|
statusBar()->clearProgressFeeds();
|
||||||
tabWidget()->feedMessageViewer()->messagesView()->reloadSelections();
|
tabWidget()->feedMessageViewer()->messagesView()->reloadSelections(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::onFeedUpdatesStarted() {
|
void FormMain::onFeedUpdatesStarted() {
|
||||||
|
@ -84,7 +84,7 @@ void MessagesView::keyboardSearch(const QString& search) {
|
|||||||
setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
|
setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesView::reloadSelections() {
|
void MessagesView::reloadSelections(bool only_if_nothing_selected) {
|
||||||
const QDateTime dt1 = QDateTime::currentDateTime();
|
const QDateTime dt1 = QDateTime::currentDateTime();
|
||||||
QModelIndex current_index = selectionModel()->currentIndex();
|
QModelIndex current_index = selectionModel()->currentIndex();
|
||||||
const QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index);
|
const QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index);
|
||||||
@ -92,6 +92,10 @@ void MessagesView::reloadSelections() {
|
|||||||
const int col = header()->sortIndicatorSection();
|
const int col = header()->sortIndicatorSection();
|
||||||
const Qt::SortOrder ord = header()->sortIndicatorOrder();
|
const Qt::SortOrder ord = header()->sortIndicatorOrder();
|
||||||
|
|
||||||
|
if (only_if_nothing_selected && selected_message.m_id > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Reload the model now.
|
// Reload the model now.
|
||||||
sort(col, ord, true, false, false);
|
sort(col, ord, true, false, false);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class MessagesView : public QTreeView {
|
|||||||
|
|
||||||
// Called after data got changed externally
|
// Called after data got changed externally
|
||||||
// and it needs to be reloaded to the view.
|
// and it needs to be reloaded to the view.
|
||||||
void reloadSelections();
|
void reloadSelections(bool only_if_nothing_selected = false);
|
||||||
|
|
||||||
// Loads un-deleted messages from selected feeds.
|
// Loads un-deleted messages from selected feeds.
|
||||||
void loadItem(RootItem* item);
|
void loadItem(RootItem* item);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user