mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-26 07:11:08 -04:00
fixed proper async call of forceUpdateDisplay()
This commit is contained in:
parent
bb10b82c8e
commit
d152d9f50c
1 changed files with 7 additions and 1 deletions
|
@ -47,6 +47,7 @@
|
||||||
#include "RSTreeWidgetItem.h"
|
#include "RSTreeWidgetItem.h"
|
||||||
#include "StatusDefs.h"
|
#include "StatusDefs.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
#include "vmessagebox.h"
|
#include "vmessagebox.h"
|
||||||
#include "util/QtVersion.h"
|
#include "util/QtVersion.h"
|
||||||
#include "gui/chat/ChatUserNotify.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)
|
void NewFriendList::handleEvent(std::shared_ptr<const RsEvent> e)
|
||||||
{
|
{
|
||||||
if(dynamic_cast<const RsConnectionEvent*>(e.get()) != nullptr)
|
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()
|
NewFriendList::~NewFriendList()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue