| 502 | } |
| 503 | |
| 504 | static QString replaceTokensIn(QString text, QMap<QString, QString> with) |
| 505 | { |
| 506 | // TODO: does this still work?? |
| 507 | QString result; |
| 508 | QRegularExpression token_regexp("\\$\\{(.+)\\}", QRegularExpression::InvertedGreedinessOption); |
| 509 | QStringList list; |
| 510 | QRegularExpressionMatchIterator i = token_regexp.globalMatch(text); |
| 511 | int lastCapturedEnd = 0; |
| 512 | while (i.hasNext()) |
| 513 | { |
| 514 | QRegularExpressionMatch match = i.next(); |
| 515 | result.append(text.mid(lastCapturedEnd, match.capturedStart())); |
| 516 | QString key = match.captured(1); |
| 517 | auto iter = with.find(key); |
| 518 | if (iter != with.end()) |
| 519 | { |
| 520 | result.append(*iter); |
| 521 | } |
| 522 | lastCapturedEnd = match.capturedEnd(); |
| 523 | } |
| 524 | result.append(text.mid(lastCapturedEnd)); |
| 525 | return result; |
| 526 | } |
| 527 | |
| 528 | QStringList MinecraftInstance::processMinecraftArgs( |
| 529 | AuthSessionPtr session, MinecraftServerTargetPtr serverToJoin) const |
no test coverage detected