mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
fixed registration of event handler
This commit is contained in:
parent
339948a15c
commit
b16c30bc3f
@ -128,8 +128,7 @@ bool p3Peers::FriendsChanged(const RsPeerId& pid,bool add)
|
||||
#endif
|
||||
if(rsEvents)
|
||||
{
|
||||
auto ev = std::make_shared<RsPeerStateChangedEvent>();
|
||||
ev->mSslId = pid;
|
||||
auto ev = std::make_shared<RsPeerStateChangedEvent>(pid);
|
||||
rsEvents->postEvent(ev);
|
||||
}
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_FRIENDS, add? NOTIFY_TYPE_ADD : NOTIFY_TYPE_DEL); // this is meant to disappear
|
||||
|
@ -178,8 +178,9 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
|
||||
|
||||
mEventHandlerId_peer=0; // forces initialization
|
||||
mEventHandlerId_gssp=0; // forces initialization
|
||||
mEventHandlerId_pssc=0; // forces initialization
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_peer, RsEventType::PEER_STATE_CHANGED );
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_pssc, RsEventType::PEER_STATE_CHANGED );
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_peer, RsEventType::PEER_CONNECTION );
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_gssp, RsEventType::GOSSIP_DISCOVERY );
|
||||
|
||||
@ -267,6 +268,7 @@ NewFriendList::~NewFriendList()
|
||||
{
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId_peer);
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId_gssp);
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId_pssc);
|
||||
|
||||
delete mModel;
|
||||
delete mProxyModel;
|
||||
|
@ -123,6 +123,7 @@ private:
|
||||
bool mShowState;
|
||||
RsEventsHandlerId_t mEventHandlerId_peer;
|
||||
RsEventsHandlerId_t mEventHandlerId_gssp;
|
||||
RsEventsHandlerId_t mEventHandlerId_pssc;
|
||||
|
||||
std::set<RsNodeGroupId> openGroups;
|
||||
std::set<RsPgpId> openPeers;
|
||||
|
Loading…
Reference in New Issue
Block a user