mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 06:40:58 -04:00
Add missing postToObjcted in RsGxsUpdateBroadcast
Deprecate RsGxsUpdateBroadcast each service should handle its own event
This commit is contained in:
parent
4c0baa1ec3
commit
dc9ba74bdd
2 changed files with 8 additions and 4 deletions
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "RsGxsUpdateBroadcast.h"
|
#include "RsGxsUpdateBroadcast.h"
|
||||||
#include "gui/notifyqt.h"
|
#include "gui/notifyqt.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
|
|
||||||
#include <retroshare/rsgxsifacehelper.h>
|
#include <retroshare/rsgxsifacehelper.h>
|
||||||
|
|
||||||
|
@ -37,11 +38,14 @@ static QMap<RsGxsIfaceHelper*, RsGxsUpdateBroadcast*> updateBroadcastMap;
|
||||||
RsGxsUpdateBroadcast::RsGxsUpdateBroadcast(RsGxsIfaceHelper *ifaceImpl) :
|
RsGxsUpdateBroadcast::RsGxsUpdateBroadcast(RsGxsIfaceHelper *ifaceImpl) :
|
||||||
QObject(nullptr), mIfaceImpl(ifaceImpl), mEventHandlerId(0)
|
QObject(nullptr), mIfaceImpl(ifaceImpl), mEventHandlerId(0)
|
||||||
{
|
{
|
||||||
/* No need of postToObject here as onChangesReceived just emit signals
|
|
||||||
* internally */
|
|
||||||
rsEvents->registerEventsHandler(
|
rsEvents->registerEventsHandler(
|
||||||
[this](std::shared_ptr<const RsEvent> event)
|
[this](std::shared_ptr<const RsEvent> event)
|
||||||
|
{
|
||||||
|
RsQThreadUtils::postToObject(
|
||||||
|
[=]()
|
||||||
{ onChangesReceived(*dynamic_cast<const RsGxsChanges*>(event.get())); },
|
{ onChangesReceived(*dynamic_cast<const RsGxsChanges*>(event.get())); },
|
||||||
|
this );
|
||||||
|
},
|
||||||
mEventHandlerId, RsEventType::GXS_CHANGES );
|
mEventHandlerId, RsEventType::GXS_CHANGES );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ struct RsGxsChanges;
|
||||||
|
|
||||||
typedef uint32_t TurtleRequestId ;
|
typedef uint32_t TurtleRequestId ;
|
||||||
|
|
||||||
class RsGxsUpdateBroadcast : public QObject
|
class RS_DEPRECATED RsGxsUpdateBroadcast : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue