From 713b2293397d5250b648c764a21a7a69aad470c0 Mon Sep 17 00:00:00 2001 From: "evgenii.tagiltsev" <tagiltsev.evgenii@gmail.com> Date: Tue, 15 Oct 2019 13:46:21 +0200 Subject: [PATCH] [*] fixed regular expression --- CellFrameDashboardGUI/DapChainWalletsModel.cpp | 2 +- CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxToken.qml | 2 +- .../DapUiQmlWidgetStatusBarComboBoxWallet.qml | 3 +++ CellFrameDashboardService/DapChainWalletHandler.cpp | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CellFrameDashboardGUI/DapChainWalletsModel.cpp b/CellFrameDashboardGUI/DapChainWalletsModel.cpp index ad72f4ef7..86d4815bf 100755 --- a/CellFrameDashboardGUI/DapChainWalletsModel.cpp +++ b/CellFrameDashboardGUI/DapChainWalletsModel.cpp @@ -1,7 +1,7 @@ #include "DapChainWalletsModel.h" -DapChainWalletsModel::DapChainWalletsModel(QObject *parent) +DapChainWalletsModel::DapChainWalletsModel(QObject *parent) : QAbstractListModel(parent) { } diff --git a/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxToken.qml b/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxToken.qml index e6fa4db7f..4f9e0f595 100644 --- a/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxToken.qml +++ b/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxToken.qml @@ -28,7 +28,7 @@ DapUiQmlWidgetStatusBarComboBoxTokenForm { fieldBalance.text = 0; else { - var money = dapChainWalletsModel.get(comboboxWallet.currentIndex).tokens[currentIndex * 2]; + var money = dapChainWalletsModel.get(comboboxWallet.currentIndex).tokens[currentIndex * 3]; fieldBalance.text = dapChainConvertor.toConvertCurrency(money); } } diff --git a/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxWallet.qml b/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxWallet.qml index f6899f524..61e627fd6 100644 --- a/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxWallet.qml +++ b/CellFrameDashboardGUI/DapUiQmlWidgetStatusBarComboBoxWallet.qml @@ -27,7 +27,10 @@ DapUiQmlWidgetStatusBarComboBoxWalletForm { onCurrentIndexChanged: { listToken.model.clear(); for(var i = 0; i < dapChainWalletsModel.get(currentIndex).count; i++) + { + console.debug(dapChainWalletsModel.get(currentIndex).tokens); listToken.model.append({"tokenName": dapChainWalletsModel.get(currentIndex).tokens[++i]}); + } if(listToken.model.count) listToken.currentIndex = 0; } diff --git a/CellFrameDashboardService/DapChainWalletHandler.cpp b/CellFrameDashboardService/DapChainWalletHandler.cpp index 8d6c250e7..3ef3f4c21 100755 --- a/CellFrameDashboardService/DapChainWalletHandler.cpp +++ b/CellFrameDashboardService/DapChainWalletHandler.cpp @@ -82,7 +82,7 @@ QStringList DapChainWalletHandler::getWalletInfo(const QString &asNameWallet) process.start(QString("%1 wallet info -w %2 -net private").arg(CLI_PATH).arg(asNameWallet)); process.waitForFinished(-1); QByteArray result = process.readAll(); - QRegExp rx("wallet: (\\w+)\\s+addr:\\s+(\\w+)\\s+(balance)|(\\d+.\\d+)\\s(\\(\\d+\\))\\s(\\w+)"); + QRegExp rx("wallet: (.+)\\s+addr:\\s+(\\w+)\\s+(balance)|(\\d+.\\d+)\\s(\\(\\d+\\))\\s(\\w+)"); QStringList list; int pos = 0; -- GitLab