mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 09:03:51 -05:00
moved notifyChatStatus to rsEvents
This commit is contained in:
parent
e6bd8335dc
commit
798775e12b
11 changed files with 101 additions and 58 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "gui/elastic/elnode.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
|
||||
/********
|
||||
* #define DEBUG_NETWORKVIEW
|
||||
|
|
@ -60,12 +61,32 @@ NetworkView::NetworkView(QWidget *parent)
|
|||
connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString)));
|
||||
|
||||
_should_update = true ;
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
RsQThreadUtils::postToObject([=](){
|
||||
auto ev = dynamic_cast<const RsGossipDiscoveryEvent *>(event.get());
|
||||
|
||||
if(!ev) return;
|
||||
|
||||
switch(ev->mGossipDiscoveryEventType)
|
||||
{
|
||||
case RsGossipDiscoveryEventType::DISCOVERY_INFO_RECEIVED: update();
|
||||
[[fallthrough]];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}, this );
|
||||
}, mEventHandlerId, RsEventType::GOSSIP_DISCOVERY );
|
||||
|
||||
}
|
||||
|
||||
NetworkView::~NetworkView()
|
||||
{
|
||||
if(mScene != NULL)
|
||||
delete mScene ;
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||
|
||||
if(mScene != NULL)
|
||||
delete mScene ;
|
||||
}
|
||||
|
||||
void NetworkView::setEdgeLength(int l)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue