diff options
| author | 2019-03-23 11:28:40 +0100 | |
|---|---|---|
| committer | 2019-03-23 11:28:40 +0100 | |
| commit | f42d6ce2ffe9e53e2ac1723e14e8797dc7b2fffd (patch) | |
| tree | 976130b3dfbc8878521cb15fc1c1141906667a79 /cli | |
| parent | 10d0da1c22c94b5361c0a6c76e008c328671ad81 (diff) | |
| download | OneRoll-f42d6ce2ffe9e53e2ac1723e14e8797dc7b2fffd.tar.gz OneRoll-f42d6ce2ffe9e53e2ac1723e14e8797dc7b2fffd.zip | |
Use new way to replace pattern in string result.
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/main.cpp b/cli/main.cpp index e261d63..2f0d8e4 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -352,18 +352,20 @@ int startDiceParsing(QStringList& cmds, QString& treeFile, bool withColor, EXPOR bool ok; QStringList allStringlist= parser.getAllStringResult(ok); QString stringResult= allStringlist.join(" ; "); + stringResult.replace("%1", scalarText); stringResult.replace("%2", listOfDiceResult.join(",").trimmed()); stringResult.replace("%3", lastScalarText); stringResult.replace("\\n", "\n"); - int i= strLst.size(); - for(auto it= strLst.rbegin(); it != strLst.rend(); ++it) + stringResult= ParsingToolBox::replaceVariableToValue(stringResult, strLst); + /*for(auto it= strLst.rbegin(); it != strLst.rend(); ++it) { stringResult.replace(QStringLiteral("$%1").arg(i), (*it)); --i; - } - i= listFull.size(); + }*/ + + int i= strLst.size(); for(auto it= strLst.rbegin(); it != strLst.rend(); ++it) { stringResult.replace(QStringLiteral("µ%1").arg(i), (*it)); |