mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-15 01:00:17 +00:00
parent
8c32302377
commit
2528c6e39a
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QRegularExpression>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
#include "base/logger.h"
|
#include "base/logger.h"
|
||||||
@ -56,8 +57,13 @@ namespace
|
|||||||
if (outputSplit.size() <= 1)
|
if (outputSplit.size() <= 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// User reports: `python --version` -> "Python 3.6.6+"
|
||||||
|
// So trim off unrelated characters
|
||||||
|
const QString versionStr = outputSplit[1];
|
||||||
|
const int idx = versionStr.indexOf(QRegularExpression("[^\\.\\d]"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
info = {exeName, outputSplit[1]};
|
info = {exeName, versionStr.left(idx)};
|
||||||
}
|
}
|
||||||
catch (const std::runtime_error &err) {
|
catch (const std::runtime_error &err) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user