Skip to content
Snippets Groups Projects
Commit 713b2293 authored by Evgenii Tagiltsev's avatar Evgenii Tagiltsev
Browse files

[*] fixed regular expression

parent a1869885
No related branches found
No related tags found
1 merge request!27Bugs 2588
Pipeline #1004 passed with stage
in 3 minutes and 29 seconds
#include "DapChainWalletsModel.h" #include "DapChainWalletsModel.h"
DapChainWalletsModel::DapChainWalletsModel(QObject *parent) DapChainWalletsModel::DapChainWalletsModel(QObject *parent) : QAbstractListModel(parent)
{ {
} }
......
...@@ -28,7 +28,7 @@ DapUiQmlWidgetStatusBarComboBoxTokenForm { ...@@ -28,7 +28,7 @@ DapUiQmlWidgetStatusBarComboBoxTokenForm {
fieldBalance.text = 0; fieldBalance.text = 0;
else else
{ {
var money = dapChainWalletsModel.get(comboboxWallet.currentIndex).tokens[currentIndex * 2]; var money = dapChainWalletsModel.get(comboboxWallet.currentIndex).tokens[currentIndex * 3];
fieldBalance.text = dapChainConvertor.toConvertCurrency(money); fieldBalance.text = dapChainConvertor.toConvertCurrency(money);
} }
} }
......
...@@ -27,7 +27,10 @@ DapUiQmlWidgetStatusBarComboBoxWalletForm { ...@@ -27,7 +27,10 @@ DapUiQmlWidgetStatusBarComboBoxWalletForm {
onCurrentIndexChanged: { onCurrentIndexChanged: {
listToken.model.clear(); listToken.model.clear();
for(var i = 0; i < dapChainWalletsModel.get(currentIndex).count; i++) 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]}); listToken.model.append({"tokenName": dapChainWalletsModel.get(currentIndex).tokens[++i]});
}
if(listToken.model.count) if(listToken.model.count)
listToken.currentIndex = 0; listToken.currentIndex = 0;
} }
......
...@@ -82,7 +82,7 @@ QStringList DapChainWalletHandler::getWalletInfo(const QString &asNameWallet) ...@@ -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.start(QString("%1 wallet info -w %2 -net private").arg(CLI_PATH).arg(asNameWallet));
process.waitForFinished(-1); process.waitForFinished(-1);
QByteArray result = process.readAll(); 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; QStringList list;
int pos = 0; int pos = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment