Apply Clang Format

This commit is contained in:
Carl Schwan
2020-11-02 16:11:24 +01:00
parent 9a2b7c0c83
commit bea870ad75
35 changed files with 5053 additions and 6370 deletions

View File

@@ -10,64 +10,72 @@
using namespace Quotient;
class PublicRoomListModel : public QAbstractListModel {
Q_OBJECT
Q_PROPERTY(Connection* connection READ connection WRITE setConnection NOTIFY
connectionChanged)
Q_PROPERTY(QString server READ server WRITE setServer NOTIFY serverChanged)
Q_PROPERTY(
QString keyword READ keyword WRITE setKeyword NOTIFY keywordChanged)
Q_PROPERTY(bool hasMore READ hasMore NOTIFY hasMoreChanged)
class PublicRoomListModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(Connection *connection READ connection WRITE setConnection NOTIFY connectionChanged)
Q_PROPERTY(QString server READ server WRITE setServer NOTIFY serverChanged)
Q_PROPERTY(QString keyword READ keyword WRITE setKeyword NOTIFY keywordChanged)
Q_PROPERTY(bool hasMore READ hasMore NOTIFY hasMoreChanged)
public:
enum EventRoles {
NameRole = Qt::DisplayRole + 1,
AvatarRole,
TopicRole,
RoomIDRole,
MemberCountRole,
AllowGuestsRole,
WorldReadableRole,
IsJoinedRole,
};
public:
enum EventRoles {
NameRole = Qt::DisplayRole + 1,
AvatarRole,
TopicRole,
RoomIDRole,
MemberCountRole,
AllowGuestsRole,
WorldReadableRole,
IsJoinedRole,
};
PublicRoomListModel(QObject* parent = nullptr);
PublicRoomListModel(QObject *parent = nullptr);
QVariant data(const QModelIndex& index, int role = NameRole) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = NameRole) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QHash<int, QByteArray> roleNames() const override;
QHash<int, QByteArray> roleNames() const override;
Connection* connection() const { return m_connection; }
void setConnection(Connection* value);
Connection *connection() const
{
return m_connection;
}
void setConnection(Connection *value);
QString server() const { return m_server; }
void setServer(const QString& value);
QString server() const
{
return m_server;
}
void setServer(const QString &value);
QString keyword() const { return m_keyword; }
void setKeyword(const QString& value);
QString keyword() const
{
return m_keyword;
}
void setKeyword(const QString &value);
bool hasMore() const;
bool hasMore() const;
Q_INVOKABLE void next(int count = 50);
Q_INVOKABLE void next(int count = 50);
private:
Connection* m_connection = nullptr;
QString m_server;
QString m_keyword;
private:
Connection *m_connection = nullptr;
QString m_server;
QString m_keyword;
bool attempted = false;
QString nextBatch;
bool attempted = false;
QString nextBatch;
QVector<PublicRoomsChunk> rooms;
QVector<PublicRoomsChunk> rooms;
QueryPublicRoomsJob* job = nullptr;
QueryPublicRoomsJob *job = nullptr;
signals:
void connectionChanged();
void serverChanged();
void keywordChanged();
void hasMoreChanged();
signals:
void connectionChanged();
void serverChanged();
void keywordChanged();
void hasMoreChanged();
};
#endif // PUBLICROOMLISTMODEL_H
#endif // PUBLICROOMLISTMODEL_H