/
Shymer123
/
Messenger
Обзор
Документация
Войти
/
Shymer123
/
Messenger
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
UI_Client/SourceFiles/DataModels/chat_data.cpp
101 строка
2 KB
Shymer123
the code has been refactored (now there are no incomprehensible 'UserRole + n') so far only in the list of chats and the list of messages
09 май 2025, 05:48
09 май 2025, 05:48
f0d1c4e
Код
Авторство
О чём код?
#include "chat_data.h" ChatData::ChatData() {} //setters void ChatData::setChatType(const ChatTypes& type) { m_chatType = type; } void ChatData::setChatID(const int id) { m_id = id; } void ChatData::setTitle(const QString &name) { m_title = name; } void ChatData::setAvatar(const QPixmap& avatar) { m_avatar = avatar; } template<typename T> void ChatData::setLastMessage(const T& lastMessage) { m_lastMessage = lastMessage; } template void ChatData::setLastMessage<QString>(const QString&); void ChatData::setLastMessageType(MessageType type) { m_lastMessageType = type; } void ChatData::setLastMessageTime(const QDateTime &time) { m_lastMessageTime = time; } void ChatData::setMemberRole(const MemberRole role) { m_memberRole = role; } void ChatData::setParticipantID(const int participantID) { m_participantID = participantID; } //getters ChatTypes ChatData::getChatType() const { return m_chatType; } int ChatData::getChatID() const { return m_id; } QString ChatData::getTitle() const { return m_title; } QPixmap ChatData::getAvatar() const { return m_avatar; } template<typename T> T ChatData::getLastMessage() const { return m_lastMessage.value<T>(); } template QString ChatData::getLastMessage() const; MessageType ChatData::getLastMessageType() const { return m_lastMessageType; } QDateTime ChatData::getLastMessageTime() const { return m_lastMessageTime; } MemberRole ChatData::getMemberRole() const { return m_memberRole; } int ChatData::getParticipantID() const { return m_participantID; }