moved GxsChanges to rsEvents

This commit is contained in:
csoler 2019-12-09 22:19:03 +01:00
parent e402630095
commit 27793627e3
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
8 changed files with 14 additions and 21 deletions

View file

@ -422,6 +422,7 @@ void NotifyQt::notifyPeerStatusChangedSummary()
emit peerStatusChangedSummary();
}
#ifdef TO_REMOVE
void NotifyQt::notifyGxsChange(const RsGxsChanges& changes)
{
{
@ -436,6 +437,7 @@ void NotifyQt::notifyGxsChange(const RsGxsChanges& changes)
emit gxsChange(changes);
}
#endif
void NotifyQt::notifyOwnStatusMessageChanged()
{

View file

@ -82,8 +82,6 @@ class NotifyQt: public QObject, public NotifyClient
/* one or more peers has changed the states */
virtual void notifyPeerStatusChangedSummary();
virtual void notifyGxsChange(const RsGxsChanges& change);
virtual void notifyHistoryChanged(uint32_t msgId, int type);
virtual void notifyDiscInfoChanged() ;

View file

@ -37,7 +37,14 @@ QMap<RsGxsIfaceHelper*, RsGxsUpdateBroadcast*> updateBroadcastMap;
RsGxsUpdateBroadcast::RsGxsUpdateBroadcast(RsGxsIfaceHelper *ifaceImpl) :
QObject(NULL), mIfaceImpl(ifaceImpl)
{
connect(NotifyQt::getInstance(), SIGNAL(gxsChange(RsGxsChanges)), this, SLOT(onChangesReceived(RsGxsChanges)));
mEventHandlerId = 0; // forces initialization in registerEventsHandler()
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
{
if(event->mType == RsEventType::GXS_CHANGES)
onChangesReceived(*dynamic_cast<const RsGxsChanges*>(event.get()));
}, mEventHandlerId );
}
void RsGxsUpdateBroadcast::cleanup()

View file

@ -24,6 +24,7 @@
#include <QObject>
#include <retroshare/rsgxsifacetypes.h>
#include <retroshare/rsevents.h>
struct RsGxsIfaceHelper;
struct RsGxsChanges;
@ -53,6 +54,7 @@ private:
private:
RsGxsIfaceHelper* mIfaceImpl;
RsEventsHandlerId_t mEventHandlerId ;
};
#endif // RSGXSUPDATEBROADCAST_H