Apply Clang Format
This commit is contained in:
@@ -10,92 +10,87 @@
|
||||
|
||||
using namespace Quotient;
|
||||
|
||||
class RoomType : public QObject {
|
||||
Q_OBJECT
|
||||
class RoomType : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Types {
|
||||
Invited = 1,
|
||||
Favorite,
|
||||
Direct,
|
||||
Normal,
|
||||
Deprioritized,
|
||||
};
|
||||
Q_ENUMS(Types)
|
||||
public:
|
||||
enum Types {
|
||||
Invited = 1,
|
||||
Favorite,
|
||||
Direct,
|
||||
Normal,
|
||||
Deprioritized,
|
||||
};
|
||||
Q_ENUMS(Types)
|
||||
};
|
||||
|
||||
class RoomListModel : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(Connection* connection READ connection WRITE setConnection)
|
||||
Q_PROPERTY(int notificationCount READ notificationCount NOTIFY
|
||||
notificationCountChanged)
|
||||
class RoomListModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(Connection *connection READ connection WRITE setConnection)
|
||||
Q_PROPERTY(int notificationCount READ notificationCount NOTIFY notificationCountChanged)
|
||||
|
||||
public:
|
||||
enum EventRoles {
|
||||
NameRole = Qt::UserRole + 1,
|
||||
AvatarRole,
|
||||
TopicRole,
|
||||
CategoryRole,
|
||||
UnreadCountRole,
|
||||
NotificationCountRole,
|
||||
HighlightCountRole,
|
||||
LastEventRole,
|
||||
LastActiveTimeRole,
|
||||
JoinStateRole,
|
||||
CurrentRoomRole,
|
||||
};
|
||||
Q_ENUM(EventRoles)
|
||||
public:
|
||||
enum EventRoles {
|
||||
NameRole = Qt::UserRole + 1,
|
||||
AvatarRole,
|
||||
TopicRole,
|
||||
CategoryRole,
|
||||
UnreadCountRole,
|
||||
NotificationCountRole,
|
||||
HighlightCountRole,
|
||||
LastEventRole,
|
||||
LastActiveTimeRole,
|
||||
JoinStateRole,
|
||||
CurrentRoomRole,
|
||||
};
|
||||
Q_ENUM(EventRoles)
|
||||
|
||||
RoomListModel(QObject* parent = nullptr);
|
||||
virtual ~RoomListModel() override;
|
||||
RoomListModel(QObject *parent = nullptr);
|
||||
virtual ~RoomListModel() override;
|
||||
|
||||
Connection* connection() const { return m_connection; }
|
||||
void setConnection(Connection* connection);
|
||||
void doResetModel();
|
||||
Connection *connection() const
|
||||
{
|
||||
return m_connection;
|
||||
}
|
||||
void setConnection(Connection *connection);
|
||||
void doResetModel();
|
||||
|
||||
Q_INVOKABLE SpectralRoom* roomAt(int row) const;
|
||||
Q_INVOKABLE SpectralRoom *roomAt(int row) const;
|
||||
|
||||
QVariant data(const QModelIndex& index,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
Q_INVOKABLE int rowCount(
|
||||
const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
int notificationCount() const { return m_notificationCount; }
|
||||
int notificationCount() const
|
||||
{
|
||||
return m_notificationCount;
|
||||
}
|
||||
|
||||
private slots:
|
||||
void doAddRoom(Room* room);
|
||||
void updateRoom(Room* room, Room* prev);
|
||||
void deleteRoom(Room* room);
|
||||
void refresh(SpectralRoom* room, const QVector<int>& roles = {});
|
||||
void refreshNotificationCount();
|
||||
private slots:
|
||||
void doAddRoom(Room *room);
|
||||
void updateRoom(Room *room, Room *prev);
|
||||
void deleteRoom(Room *room);
|
||||
void refresh(SpectralRoom *room, const QVector<int> &roles = {});
|
||||
void refreshNotificationCount();
|
||||
|
||||
private:
|
||||
Connection* m_connection = nullptr;
|
||||
QList<SpectralRoom*> m_rooms;
|
||||
private:
|
||||
Connection *m_connection = nullptr;
|
||||
QList<SpectralRoom *> m_rooms;
|
||||
|
||||
int m_notificationCount = 0;
|
||||
int m_notificationCount = 0;
|
||||
|
||||
void connectRoomSignals(SpectralRoom* room);
|
||||
void connectRoomSignals(SpectralRoom *room);
|
||||
|
||||
signals:
|
||||
void connectionChanged();
|
||||
void notificationCountChanged();
|
||||
signals:
|
||||
void connectionChanged();
|
||||
void notificationCountChanged();
|
||||
|
||||
void roomAdded(SpectralRoom* room);
|
||||
void newMessage(const QString& roomId,
|
||||
const QString& eventId,
|
||||
const QString& roomName,
|
||||
const QString& senderName,
|
||||
const QString& text,
|
||||
const QImage& icon);
|
||||
void newHighlight(const QString& roomId,
|
||||
const QString& eventId,
|
||||
const QString& roomName,
|
||||
const QString& senderName,
|
||||
const QString& text,
|
||||
const QImage& icon);
|
||||
void roomAdded(SpectralRoom *room);
|
||||
void newMessage(const QString &roomId, const QString &eventId, const QString &roomName, const QString &senderName, const QString &text, const QImage &icon);
|
||||
void newHighlight(const QString &roomId, const QString &eventId, const QString &roomName, const QString &senderName, const QString &text, const QImage &icon);
|
||||
};
|
||||
|
||||
#endif // ROOMLISTMODEL_H
|
||||
#endif // ROOMLISTMODEL_H
|
||||
|
||||
Reference in New Issue
Block a user