refactor: Event, make non default constructors explicit

This commit is contained in:
sithlord48
2025-07-28 08:20:29 -04:00
committed by Nick Bolton
parent 283e0c6367
commit 49e36cfdc6
3 changed files with 8 additions and 8 deletions

View File

@ -45,7 +45,7 @@ public:
\p target is the intended recipient of the event.
\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
/*!
@ -53,7 +53,7 @@ public:
\p target is the intended recipient of the event.
\p dataObject with event data
*/
Event(EventTypes type, void *target, EventData *dataObject);
explicit Event(EventTypes type, void *target, EventData *dataObject);
//! @name manipulators
//@{

View File

@ -73,7 +73,7 @@ void PortalInputCapture::handleSessionClosed(XdpSession *session)
{
LOG_ERR("portal input capture session was closed, exiting");
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));
m_signals.at(Signal::SessionClosed) = 0;
@ -88,7 +88,7 @@ void PortalInputCapture::handleInitSession(GObject *object, GAsyncResult *res)
if (!session) {
LOG_ERR("failed to initialize input capture session, quitting: %s", error->message);
g_main_loop_quit(m_glibMainLoop);
m_events->addEvent(EventTypes::Quit);
m_events->addEvent(Event(EventTypes::Quit));
return;
}
@ -98,7 +98,7 @@ void PortalInputCapture::handleInitSession(GObject *object, GAsyncResult *res)
if (fd < 0) {
LOG_ERR("failed to connect to eis: %s", error->message);
g_main_loop_quit(m_glibMainLoop);
m_events->addEvent(EventTypes::Quit);
m_events->addEvent(Event(EventTypes::Quit));
return;
}

View File

@ -83,7 +83,7 @@ void PortalRemoteDesktop::handleSessionStarted(GObject *object, GAsyncResult *re
if (!xdp_session_start_finish(session, res, &error)) {
LOG_ERR("failed to start portal remote desktop session, quitting: %s", error->message);
g_main_loop_quit(m_glibMainLoop);
m_events->addEvent(EventTypes::Quit);
m_events->addEvent(Event(EventTypes::Quit));
return;
}
@ -96,7 +96,7 @@ void PortalRemoteDesktop::handleSessionStarted(GObject *object, GAsyncResult *re
fd = xdp_session_connect_to_eis(session, &error);
if (fd < 0) {
g_main_loop_quit(m_glibMainLoop);
m_events->addEvent(EventTypes::Quit);
m_events->addEvent(Event(EventTypes::Quit));
return;
}
@ -116,7 +116,7 @@ void PortalRemoteDesktop::handleInitSession(GObject *object, GAsyncResult *res)
// fails.
if (m_sessionIteration == 0) {
g_main_loop_quit(m_glibMainLoop);
m_events->addEvent(EventTypes::Quit);
m_events->addEvent(Event(EventTypes::Quit));
} else {
this->reconnect(1000);
}