Hush lite wallet
https://faq.hush.is/sdl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
#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;
|
|
}
|
|
|