mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
improve the version check
This commit is contained in:
parent
f65178eb19
commit
5dceeffc25
10
.vscode/settings.json
vendored
Normal file
10
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"qregularexpression": "cpp",
|
||||||
|
"qfileinfo": "cpp",
|
||||||
|
"qregularexpressionmatch": "cpp",
|
||||||
|
"qdatetime": "cpp",
|
||||||
|
"qprocess": "cpp",
|
||||||
|
"qobject": "cpp"
|
||||||
|
}
|
||||||
|
}
|
@ -127,9 +127,9 @@ bool GPService::isValidVersion(QString &bin) {
|
|||||||
QProcess p;
|
QProcess p;
|
||||||
p.start(bin, QStringList("--version"));
|
p.start(bin, QStringList("--version"));
|
||||||
p.waitForFinished();
|
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);
|
QRegularExpressionMatch match = re.match(output);
|
||||||
|
|
||||||
if (match.hasMatch()) {
|
if (match.hasMatch()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user