Update ChatDocumentHandler so RoomManger is no longer required for saving text

Update `ChatDocumentHandler` so `RoomManger` is no longer required for saving the text in the chatbar between room switches. This is achieved by allowing `ChatDocumentHandler` to get the correct `ChatBarChache` itself rather than having to have it passed from `ChatBar.qml`. This avoids any race conditions.
This commit is contained in:
James Graham
2025-08-02 10:56:20 +01:00
parent 401cf29ca8
commit dc32f2f947
10 changed files with 117 additions and 84 deletions

View File

@@ -0,0 +1,31 @@
// SPDX-FileCopyrightText: 2025 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <QObject>
#include <QQmlEngine>
/**
* @class ChatBarType
*
* This class is designed to define the ChatBarType enumeration.
*/
class ChatBarType : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
public:
/**
* @brief The type of chatbar.
*/
enum Type {
Room = 0, /**< A standard room chatbar for creating new messages. */
Edit, /**< A chatbar for editing an existing message. */
Thread, /**< A chatbar for creating a new threaded message. */
None, /**< Undefined. */
};
Q_ENUM(Type);
};