refactor: Event, make non default constructors explicit
This commit is contained in:
parent
283e0c6367
commit
49e36cfdc6
3 changed files with 8 additions and 8 deletions
|
|
@ -45,7 +45,7 @@ public:
|
||||||
\p target is the intended recipient of the event.
|
\p target is the intended recipient of the event.
|
||||||
\p flags is any combination of \c Flags.
|
\p flags is any combination of \c Flags.
|
||||||
*/
|
*/
|
||||||
Event(EventTypes type, void *target = nullptr, void *data = nullptr, Flags flags = EventFlags::NoFlags);
|
explicit Event(EventTypes type, void *target = nullptr, void *data = nullptr, Flags flags = EventFlags::NoFlags);
|
||||||
|
|
||||||
//! Create \c Event with non-POD data
|
//! Create \c Event with non-POD data
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -53,7 +53,7 @@ public:
|
||||||
\p target is the intended recipient of the event.
|
\p target is the intended recipient of the event.
|
||||||
\p dataObject with event data
|
\p dataObject with event data
|
||||||
*/
|
*/
|
||||||
Event(EventTypes type, void *target, EventData *dataObject);
|
explicit Event(EventTypes type, void *target, EventData *dataObject);
|
||||||
|
|
||||||
//! @name manipulators
|
//! @name manipulators
|
||||||
//@{
|
//@{
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ void PortalInputCapture::handleSessionClosed(XdpSession *session)
|
||||||
{
|
{
|
||||||
LOG_ERR("portal input capture session was closed, exiting");
|
LOG_ERR("portal input capture session was closed, exiting");
|
||||||
g_main_loop_quit(m_glibMainLoop);
|
g_main_loop_quit(m_glibMainLoop);
|
||||||
m_events->addEvent(EventTypes::Quit);
|
m_events->addEvent(Event(EventTypes::Quit));
|
||||||
|
|
||||||
g_signal_handler_disconnect(session, m_signals.at(Signal::SessionClosed));
|
g_signal_handler_disconnect(session, m_signals.at(Signal::SessionClosed));
|
||||||
m_signals.at(Signal::SessionClosed) = 0;
|
m_signals.at(Signal::SessionClosed) = 0;
|
||||||
|
|
@ -88,7 +88,7 @@ void PortalInputCapture::handleInitSession(GObject *object, GAsyncResult *res)
|
||||||
if (!session) {
|
if (!session) {
|
||||||
LOG_ERR("failed to initialize input capture session, quitting: %s", error->message);
|
LOG_ERR("failed to initialize input capture session, quitting: %s", error->message);
|
||||||
g_main_loop_quit(m_glibMainLoop);
|
g_main_loop_quit(m_glibMainLoop);
|
||||||
m_events->addEvent(EventTypes::Quit);
|
m_events->addEvent(Event(EventTypes::Quit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ void PortalInputCapture::handleInitSession(GObject *object, GAsyncResult *res)
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
LOG_ERR("failed to connect to eis: %s", error->message);
|
LOG_ERR("failed to connect to eis: %s", error->message);
|
||||||
g_main_loop_quit(m_glibMainLoop);
|
g_main_loop_quit(m_glibMainLoop);
|
||||||
m_events->addEvent(EventTypes::Quit);
|
m_events->addEvent(Event(EventTypes::Quit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ void PortalRemoteDesktop::handleSessionStarted(GObject *object, GAsyncResult *re
|
||||||
if (!xdp_session_start_finish(session, res, &error)) {
|
if (!xdp_session_start_finish(session, res, &error)) {
|
||||||
LOG_ERR("failed to start portal remote desktop session, quitting: %s", error->message);
|
LOG_ERR("failed to start portal remote desktop session, quitting: %s", error->message);
|
||||||
g_main_loop_quit(m_glibMainLoop);
|
g_main_loop_quit(m_glibMainLoop);
|
||||||
m_events->addEvent(EventTypes::Quit);
|
m_events->addEvent(Event(EventTypes::Quit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ void PortalRemoteDesktop::handleSessionStarted(GObject *object, GAsyncResult *re
|
||||||
fd = xdp_session_connect_to_eis(session, &error);
|
fd = xdp_session_connect_to_eis(session, &error);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
g_main_loop_quit(m_glibMainLoop);
|
g_main_loop_quit(m_glibMainLoop);
|
||||||
m_events->addEvent(EventTypes::Quit);
|
m_events->addEvent(Event(EventTypes::Quit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ void PortalRemoteDesktop::handleInitSession(GObject *object, GAsyncResult *res)
|
||||||
// fails.
|
// fails.
|
||||||
if (m_sessionIteration == 0) {
|
if (m_sessionIteration == 0) {
|
||||||
g_main_loop_quit(m_glibMainLoop);
|
g_main_loop_quit(m_glibMainLoop);
|
||||||
m_events->addEvent(EventTypes::Quit);
|
m_events->addEvent(Event(EventTypes::Quit));
|
||||||
} else {
|
} else {
|
||||||
this->reconnect(1000);
|
this->reconnect(1000);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue