#include "NoteCountDataStore.h" NoteCountDataStore* NoteCountDataStore::instance = nullptr; bool NoteCountDataStore::instanced = false; NoteCountDataStore* NoteCountDataStore::getInstance() { if (!instanced) { instanced = true; instance = new NoteCountDataStore(); } return instance; } void NoteCountDataStore::clear() { data.clear(); } void NoteCountDataStore::setData(const QString& key, const QString& value) { data[key] = value; } QString NoteCountDataStore::getData(const QString& key) { return data.value(key); } QString NoteCountDataStore::dump() { QString result; for (const auto& key : data.keys()) { result += key + ": " + data[key] + "\n"; } return result; } void NoteCountDataStore::setSpendableNotesCount(int count) { spendableNotesCount = count; } int NoteCountDataStore::getSpendableNotesCount() const { return spendableNotesCount; } void NoteCountDataStore::setAddressWithMaxValue(const QString& address, int value) { if (value > maxValue) { maxValue = value; addressWithMaxValue = address; } } QString NoteCountDataStore::getAddressWithMaxValue() const { return addressWithMaxValue; }