Skip to content
Snippets Groups Projects
Commit dfea362c authored by jonymt's avatar jonymt
Browse files

[*] changed regexp

parent ef901599
No related branches found
No related tags found
1 merge request!11Cellframe clone
......@@ -78,7 +78,6 @@ void DapScreenHistoryModel::receiveNewData(const QVariant& aData)
item.WalletNumber = dataItem.at(5);
// TODO: Later we should convert currency
item.Currency = "$ 0 USD";
qWarning() << aData;
switch (item.Status) {
case DapTransactionStatus::stSent: item.Cryptocurrency.prepend("- "); break;
......
......@@ -29,13 +29,12 @@ void DapChainHistoryHandler::onRequestNewHistory(const QMap<QString, QVariant>&
if(!result.isEmpty())
{
QRegExp rx("(\\w{3} \\w{3} \\d+ \\d{1,2}:\\d{2}:\\d{2} \\d{4})\\s+"
"(\\w+) (\\d+) (\\w+) \\w+ (\\w+)");
QRegExp rx("((\\w{3}\\s){2}\\d{1,2}\\s(\\d{1,2}:*){3}\\s\\d{4})\\s+(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s([\\w\\d]+)");
int pos = 0;
while ((pos = rx.indexIn(result, pos)) != -1)
{
QStringList dataItem = QStringList() << rx.cap(1) << QString::number(DapTransactionStatusConvertor::getStatusByShort(rx.cap(2))) << rx.cap(3) << rx.cap(4) << rx.cap(5) << wallets.at(i).toString();
QStringList dataItem = QStringList() << rx.cap(1) << QString::number(DapTransactionStatusConvertor::getStatusByShort(rx.cap(4))) << rx.cap(5) << rx.cap(6) << rx.cap(7) << wallets.at(i).toString();
qDebug() << "NEW MATCH" << pos << dataItem;
data << dataItem;
pos += rx.matchedLength();
......
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