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

@@ -122,9 +122,7 @@ void NotificationsModel::loadData()
const auto &authorAvatar = avatar.isValid() && avatar.scheme() == QStringLiteral("mxc") ? avatar : QUrl();
const auto &roomEvent = eventCast<const RoomEvent>(notification.event.get());
EventHandler eventHandler;
eventHandler.setRoom(dynamic_cast<NeoChatRoom *>(room));
eventHandler.setEvent(roomEvent);
EventHandler eventHandler(dynamic_cast<NeoChatRoom *>(room), roomEvent);
beginInsertRows({}, m_notifications.length(), m_notifications.length());
m_notifications += Notification{
.roomId = notification.roomId,