Port some things away from Controller::activeConnection

This commit is contained in:
Tobias Fella
2023-11-04 23:26:41 +01:00
parent ff4cf86ea5
commit 0e55c3b38f
29 changed files with 289 additions and 154 deletions

View File

@@ -10,6 +10,8 @@
#include <QQmlEngine>
#include <QUrl>
class NeoChatConnection;
/**
* @class ServerListModel
*
@@ -27,6 +29,8 @@ class ServerListModel : public QAbstractListModel
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(NeoChatConnection *connection READ connection WRITE setConnection NOTIFY connectionChanged)
public:
/**
* @brief Define the data required to represent a server.
@@ -96,10 +100,15 @@ public:
*/
Q_INVOKABLE void removeServerAtIndex(int index);
NeoChatConnection *connection() const;
void setConnection(NeoChatConnection *connection);
Q_SIGNALS:
void serverCheckComplete(QString url, bool valid);
void connectionChanged();
private:
QList<Server> m_servers;
QPointer<Quotient::QueryPublicRoomsJob> m_checkServerJob = nullptr;
NeoChatConnection *m_connection = nullptr;
};