update// reformated datastore and changed storage chatmodel to store with datastore

This commit is contained in:
Strider
2020-05-08 21:16:40 +02:00
parent d0562d2c65
commit 30ddc479ba
11 changed files with 104 additions and 88 deletions

View File

@@ -0,0 +1,42 @@
#include "ChatDataStore.h"
ChatDataStore* ChatDataStore::getInstance()
{
if(!ChatDataStore::instanced)
{
ChatDataStore::instanced = true;
ChatDataStore::instance = new ChatDataStore();
}
return ChatDataStore::instance;
}
void ChatDataStore::clear()
{
this->data.clear();
}
void ChatDataStore::setData(QString key, ChatItem value)
{
this->data[key] = value;
}
ChatItem ChatDataStore::getData(QString key)
{
return this->data[key];
}
QString ChatDataStore::dump()
{
return "";
}
std::map<QString, ChatItem> ChatDataStore::getAllRawChatItems()
{
return this->data;
}
ChatDataStore* ChatDataStore::instance = nullptr;
bool ChatDataStore::instanced = false;