mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-02 18:44:53 -05:00
centralized forceRedraw() in boards
This commit is contained in:
parent
28568621a1
commit
a129f6e6f9
@ -276,7 +276,7 @@ void PostedListWidgetWithModel::switchDisplayMode()
|
|||||||
mPostedPostsDelegate->setDisplayMode(BoardPostDisplayWidget::DISPLAY_MODE_CARD_VIEW);
|
mPostedPostsDelegate->setDisplayMode(BoardPostDisplayWidget::DISPLAY_MODE_CARD_VIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
mPostedPostsModel->deepUpdate();
|
forceRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostedListWidgetWithModel::updateSorting(int s)
|
void PostedListWidgetWithModel::updateSorting(int s)
|
||||||
@ -541,8 +541,27 @@ void PostedListWidgetWithModel::postPostLoad()
|
|||||||
void PostedListWidgetWithModel::forceRedraw()
|
void PostedListWidgetWithModel::forceRedraw()
|
||||||
{
|
{
|
||||||
if(mPostedPostsModel)
|
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<RsGxsMessageId> msgs;
|
||||||
|
//
|
||||||
|
// for(auto& index: lst)
|
||||||
|
// msgs.insert(index.data(Qt::UserRole).value<RsPostedPost>().mMeta.mMsgId) ;
|
||||||
|
|
||||||
mPostedPostsModel->deepUpdate();
|
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)
|
void PostedListWidgetWithModel::updateDisplay(bool complete)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_CHANNEL
|
#ifdef DEBUG_CHANNEL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user