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,30 +31,12 @@ class ReactionModel;
* information. This is to minimize warnings from QML especially during startup
* and room changes.
*/
class EventHandler : public QObject
class EventHandler
{
Q_OBJECT
Q_GADGET
public:
/**
* @brief Return the current room the EventHandler is using.
*/
const NeoChatRoom *getRoom() const;
/**
* @brief Set the current room the EventHandler to using.
*/
void setRoom(const NeoChatRoom *room);
/**
* @brief Return the current event the EventHandler is using.
*/
const Quotient::Event *getEvent() const;
/**
* @brief Set the current event the EventHandler to using.
*/
void setEvent(const Quotient::RoomEvent *event);
EventHandler(const NeoChatRoom *room, const Quotient::RoomEvent *event);
/**
* @brief Return the Matrix ID of the event.