improve the version check

This commit is contained in:
Kevin Yue
2021-09-18 22:15:39 +08:00
parent f65178eb19
commit 5dceeffc25
2 changed files with 12 additions and 2 deletions

View File

@@ -127,9 +127,9 @@ bool GPService::isValidVersion(QString &bin) {
QProcess p;
p.start(bin, QStringList("--version"));
p.waitForFinished();
QString output = p.readAllStandardOutput();
QString output = p.readAll();
QRegularExpression re("v(\\d+).*?\\n");
QRegularExpression re("v(\\d+).*?(\\s|\\n)");
QRegularExpressionMatch match = re.match(output);
if (match.hasMatch()) {