diff --git a/src/lib/base/Event.h b/src/lib/base/Event.h index a98b1c792..c7d0efffe 100644 --- a/src/lib/base/Event.h +++ b/src/lib/base/Event.h @@ -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 //@{ diff --git a/src/lib/platform/PortalInputCapture.cpp b/src/lib/platform/PortalInputCapture.cpp index 6ab0c2bc0..5a44d85db 100644 --- a/src/lib/platform/PortalInputCapture.cpp +++ b/src/lib/platform/PortalInputCapture.cpp @@ -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; } diff --git a/src/lib/platform/PortalRemoteDesktop.cpp b/src/lib/platform/PortalRemoteDesktop.cpp index 388272a73..8ca533b9d 100644 --- a/src/lib/platform/PortalRemoteDesktop.cpp +++ b/src/lib/platform/PortalRemoteDesktop.cpp @@ -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); }