Refactor error handling and move unrelated functions out of ActionsHandler

This commit is contained in:
Tobias Fella
2021-04-15 16:41:48 +02:00
parent 077844ba61
commit 00681a8abe
5 changed files with 62 additions and 55 deletions

View File

@@ -72,6 +72,12 @@ public:
};
Q_ENUM(PasswordStatus);
/// \brief Create new room for a group chat.
void createRoom(const QString &name, const QString &topic);
/// \brief Join a room.
void joinRoom(const QString &alias);
private:
explicit Controller(QObject *parent = nullptr);
~Controller() override;
@@ -94,7 +100,14 @@ private Q_SLOTS:
Q_SIGNALS:
void busyChanged();
/// Error occurred because of user inputs
void errorOccured(QString error, QString detail);
void errorOccured(const QString &error);
/// \brief Emitted when an action made the user join a room.
///
/// Either when a new room was created, a direct chat was started
/// or a group chat was joined. The UI will react to this signal
/// and switch to the newly joined room.
void roomJoined(const QString &roomName);
/// Error occurred because of server or bug in NeoChat
void globalErrorOccured(QString error, QString detail);