mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-29 11:56:37 -05:00
fixed bug caused by accessing Settings from non Qt thread
This commit is contained in:
parent
f118b4656e
commit
b6ca07aaa3
4 changed files with 14 additions and 9 deletions
|
|
@ -177,6 +177,7 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
|||
ui->filterLineEdit->setPlaceholderText(tr("Search")) ;
|
||||
ui->filterLineEdit->showFilterIcon();
|
||||
|
||||
mEventHandlerId=0; // forces initialization
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId );
|
||||
|
||||
mModel = new RsFriendListModel();
|
||||
|
|
@ -257,7 +258,7 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
|||
|
||||
void NewFriendList::handleEvent(std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
if(dynamic_cast<const RsConnectionEvent*>(e.get()) != nullptr)
|
||||
if(e->mType == RsEventType::PEER_CONNECTION)
|
||||
{
|
||||
// /!\ 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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue