diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 84ff81d75..f57ddf5f0 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -276,7 +276,7 @@ void PostedListWidgetWithModel::switchDisplayMode() mPostedPostsDelegate->setDisplayMode(BoardPostDisplayWidget::DISPLAY_MODE_CARD_VIEW); } - mPostedPostsModel->deepUpdate(); + forceRedraw(); } void PostedListWidgetWithModel::updateSorting(int s) @@ -541,8 +541,27 @@ void PostedListWidgetWithModel::postPostLoad() void PostedListWidgetWithModel::forceRedraw() { if(mPostedPostsModel) + { +// // Save selection. This can only be done using message Ids, because the QModelIndex-es can change after deepUpdate +// +// auto lst = ui->postsTree->selectionModel()->selectedRows(); +// std::set msgs; +// +// for(auto& index: lst) +// msgs.insert(index.data(Qt::UserRole).value().mMeta.mMsgId) ; + mPostedPostsModel->deepUpdate(); + +// // Restore selection +// +// for(auto& msgId: msgs) +// ui->postsTree->selectionModel()->select(mPostedPostsModel->getIndexOfMessage(msgId), QItemSelectionModel::ClearAndSelect); +// +// update(); +// ui->postsTree->update(); + } } + void PostedListWidgetWithModel::updateDisplay(bool complete) { #ifdef DEBUG_CHANNEL