RoomManger connection

RoomManger should just get it's connection from Controller, no need to involve QML
This commit is contained in:
James Graham
2024-03-30 19:48:34 +00:00
parent 64b8cd5bcc
commit eaf4663c84
5 changed files with 10 additions and 12 deletions

View File

@@ -5,6 +5,7 @@
#include "roommanager.h"
#include "chatbarcache.h"
#include "controller.h"
#include "eventhandler.h"
#include "messagecomponenttype.h"
#include "models/timelinemodel.h"
@@ -42,6 +43,10 @@ RoomManager::RoomManager(QObject *parent)
connect(this, &RoomManager::currentRoomChanged, this, [this]() {
m_timelineModel->setRoom(m_currentRoom);
});
connect(&Controller::instance(), &Controller::activeConnectionChanged, this, [this](NeoChatConnection *connection) {
setConnection(connection);
});
}
RoomManager::~RoomManager()
@@ -397,11 +402,6 @@ void RoomManager::setChatDocumentHandler(ChatDocumentHandler *handler)
Q_EMIT chatDocumentHandlerChanged();
}
NeoChatConnection *RoomManager::connection() const
{
return m_connection;
}
void RoomManager::setConnection(NeoChatConnection *connection)
{
if (m_connection == connection) {