Refactor EventHandler

Refactor EventHandler to be a Q_GADGET and create from a constructor
This commit is contained in:
James Graham
2024-01-26 17:17:53 +00:00
parent 27662f9a4a
commit 95fff4c9f7
9 changed files with 98 additions and 195 deletions

View File

@@ -31,34 +31,10 @@
using namespace Quotient;
const NeoChatRoom *EventHandler::getRoom() const
EventHandler::EventHandler(const NeoChatRoom *room, const RoomEvent *event)
: m_room(room)
, m_event(event)
{
return m_room;
}
void EventHandler::setRoom(const NeoChatRoom *room)
{
if (room == m_room) {
return;
}
m_room = room;
}
const Quotient::Event *EventHandler::getEvent() const
{
return m_event;
}
void EventHandler::setEvent(const Quotient::RoomEvent *event)
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "cannot setEvent when m_room is set to nullptr.";
return;
}
if (event == m_event) {
return;
}
m_event = event;
}
QString EventHandler::getId() const