2022-02-14 14:38:41 +00:00
|
|
|
#include "item.h"
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
namespace Modules::Main::Wallet::Accounts
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
2022-02-21 17:07:16 +00:00
|
|
|
Item::Item(QObject* parent,
|
|
|
|
const QString& name,
|
|
|
|
const QString& address,
|
|
|
|
const QString& path,
|
|
|
|
const QString& color,
|
|
|
|
const QString& publicKey,
|
|
|
|
const QString& walletType,
|
2022-02-21 18:03:38 +00:00
|
|
|
bool isWallet,
|
|
|
|
bool isChat,
|
|
|
|
float currencyBalance)
|
2022-02-21 17:07:16 +00:00
|
|
|
: QObject(parent)
|
|
|
|
, m_name(name)
|
2022-02-21 18:03:38 +00:00
|
|
|
, m_address(address)
|
|
|
|
, m_path(path)
|
|
|
|
, m_color(color)
|
|
|
|
, m_publicKey(publicKey)
|
|
|
|
, m_walletType(walletType)
|
|
|
|
, m_isWallet(isWallet)
|
|
|
|
, m_isChat(isChat)
|
|
|
|
, m_currencyBalance(currencyBalance)
|
2022-02-14 14:38:41 +00:00
|
|
|
{ }
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
const QString& Item::getName() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_name;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
const QString& Item::getAddress() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_address;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
const QString& Item::getPath() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_path;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
const QString& Item::getColor() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_color;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
const QString& Item::getPublicKey() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_publicKey;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
const QString& Item::getWalletType() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_walletType;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
bool Item::getIsWallet() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_isWallet;
|
|
|
|
}
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
bool Item::getIsChat() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_isChat;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
float Item::getCurrencyBalance() const
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
return m_currencyBalance;
|
|
|
|
}
|
|
|
|
|
2022-02-21 17:07:16 +00:00
|
|
|
void Item::setData(Item* item)
|
|
|
|
{
|
|
|
|
if(item)
|
|
|
|
{
|
|
|
|
m_name = item->getName();
|
|
|
|
emit nameChanged();
|
|
|
|
m_address = item->getAddress();
|
|
|
|
emit addressChanged();
|
|
|
|
m_path = item->getPath();
|
|
|
|
emit pathChanged();
|
|
|
|
m_color = item->getColor();
|
|
|
|
emit colorChanged();
|
|
|
|
m_publicKey = item->getPublicKey();
|
|
|
|
emit publicKeyChanged();
|
|
|
|
m_walletType = item->getWalletType();
|
|
|
|
emit walletTypeChanged();
|
|
|
|
m_isWallet = item->getIsWallet();
|
|
|
|
emit isWalletChanged();
|
|
|
|
m_isChat = item->getIsChat();
|
|
|
|
emit isChatChanged();
|
|
|
|
m_currencyBalance = item->getCurrencyBalance();
|
|
|
|
emit currencyBalanceChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
} // namespace Modules::Main::Wallet::Accounts
|