Patryk Osmaczko c0024ec6b1 refactor(@desktop/cpp): improve cpp code
Good coding practices applied only,
architecture and logic were not altered.
2022-03-01 16:05:21 +01:00

21 lines
684 B
C++

#include "wallet_accounts/wallet_account.h"
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QStringList>
Wallets::WalletAccountDto Wallets::toWalletAccountDto(const QJsonValue& jsonObj)
{
auto result = Wallets::WalletAccountDto();
result.name = jsonObj["name"].toString();
result.address = jsonObj["address"].toString();
result.path = jsonObj["path"].toString();
result.color = jsonObj["color"].toString();
result.isWallet = jsonObj["wallet"].toBool();
result.isChat = jsonObj["chat"].toBool();
result.publicKey = jsonObj["public-key"].toString();
result.walletType = jsonObj["type"].toString();
return result;
}