MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / pubEvent

Method pubEvent

src/framework/event/eventcallproxy.cpp:22–35  ·  view source on GitHub ↗

! * \brief EventCallProxy::pubEvent Send event objects to * all `handlers` that have subscribed to the topic, * and the `eventProcess` function of the `handler` will be called * \param event * \return true if success */

Source from the content-addressed store, hash-verified

20 * \return true if success
21 */
22bool EventCallProxy::pubEvent(const Event &event)
23{
24 bool flag = false;
25 QList<EventCallProxy::HandlerInfo> &infoGroup = getInfoList();
26 for (HandlerInfo &info : infoGroup) {
27 if (!info.topics.contains(event.topic()))
28 continue;
29 if (Q_LIKELY(info.invoke)) {
30 info.invoke(info, event);
31 flag = true;
32 }
33 }
34 return flag;
35}
36
37/*!
38 * \brief EventCallProxy::registerHandler no need for developers to call directly,

Callers 6

sendEventFunction · 0.80
configureMethod · 0.80
notifyBuildStateMethod · 0.80
buildProjectMethod · 0.80
gengrateWorkspaceMethod · 0.80

Calls 3

topicMethod · 0.80
containsMethod · 0.45
invokeMethod · 0.45

Tested by

no test coverage detected