From: tobtoht Date: Tue, 13 Jun 2023 10:39:23 +0000 (+0200) Subject: account: fix balance order X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=f8a3df148906727dd92cb5f4386f3e864a72e64b;p=gamesguru%2Ffeather.git account: fix balance order --- diff --git a/src/model/SubaddressAccountModel.cpp b/src/model/SubaddressAccountModel.cpp index 04ef33d8..138d684b 100644 --- a/src/model/SubaddressAccountModel.cpp +++ b/src/model/SubaddressAccountModel.cpp @@ -7,6 +7,8 @@ #include #include "utils/Utils.h" +#include "libwalletqt/WalletManager.h" + SubaddressAccountModel::SubaddressAccountModel(QObject *parent, SubaddressAccount *subaddressAccount) : QAbstractTableModel(parent) , m_subaddressAccount(subaddressAccount) @@ -84,8 +86,14 @@ QVariant SubaddressAccountModel::parseSubaddressAccountRow(const Monero::Subaddr case Label: return QString::fromStdString(row.getLabel()); case Balance: + if (role == Qt::UserRole) { + return WalletManager::amountFromString(QString::fromStdString(row.getBalance())); + } return QString::fromStdString(row.getBalance()); case UnlockedBalance: + if (role == Qt::UserRole) { + return WalletManager::amountFromString(QString::fromStdString(row.getUnlockedBalance())); + } return QString::fromStdString(row.getUnlockedBalance()); default: return QVariant();