mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-06 14:03:54 -04:00
fixed proper async call of forceUpdateDisplay()
This commit is contained in:
parent
bb10b82c8e
commit
d152d9f50c
@ -47,6 +47,7 @@
|
||||
#include "RSTreeWidgetItem.h"
|
||||
#include "StatusDefs.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "vmessagebox.h"
|
||||
#include "util/QtVersion.h"
|
||||
#include "gui/chat/ChatUserNotify.h"
|
||||
@ -257,7 +258,12 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
||||
void NewFriendList::handleEvent(std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
if(dynamic_cast<const RsConnectionEvent*>(e.get()) != nullptr)
|
||||
forceUpdateDisplay();
|
||||
{
|
||||
// /!\ The function we're in is called from a different thread. It's very important
|
||||
// to use this trick in order to avoid data races.
|
||||
|
||||
RsQThreadUtils::postToObject( [=]() { forceUpdateDisplay() ; }, this ) ;
|
||||
}
|
||||
}
|
||||
|
||||
NewFriendList::~NewFriendList()
|
||||
|
Loading…
x
Reference in New Issue
Block a user