/
Shymer123
/
Messenger
Обзор
Документация
Войти
/
Shymer123
/
Messenger
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
UI_Client/SourceFiles/DataModels/user_data.cpp
64 строки
904 B
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 "user_data.h" UserData& UserData::instance() { static UserData instance; return instance; } void UserData::resetChatInfo() { m_chatID = -1; } //setters void UserData::setID(const int id) { m_id = id; } void UserData::setUserName(const QString& userName) { m_userName = userName; } void UserData::setPhoneNumber(const QString& phoneNumber) { m_phoneNumber = phoneNumber; } void UserData::setCurrentChatType(const ChatTypes& type) { m_chatType = type; } void UserData::setCurrentChatID(const int chatID) { m_chatID = chatID; } //getters int UserData::getID() const { return m_id; } QString UserData::getUserName() const { return m_userName; } QString UserData::getPhoneNumber() const { return m_phoneNumber; } ChatTypes UserData::getChatType() const { return m_chatType; } int UserData::getCurrentChatID() const { return m_chatID; }