mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-27 11:00:54 +00:00
Changed: One second timeout to get version, see #279
This commit is contained in:
parent
e4e1d86963
commit
d08fa081b5
1 changed files with 11 additions and 8 deletions
|
@ -260,17 +260,20 @@ QString getVersionFromExecutable(const QString &path)
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
|
||||||
// read all output
|
// read all output
|
||||||
while (process.waitForReadyRead()) data.append(process.readAll());
|
while (process.waitForReadyRead(1000)) data.append(process.readAll());
|
||||||
|
|
||||||
QString versionString = QString::fromUtf8(data);
|
if (!data.isEmpty())
|
||||||
|
{
|
||||||
|
QString versionString = QString::fromUtf8(data);
|
||||||
|
|
||||||
// parse version from output (client)
|
// parse version from output (client)
|
||||||
QRegExp reg("([A-Za-z0-1_.]+) ((DEV|FV) ([0-9.]+))");
|
QRegExp reg("([A-Za-z0-1_.]+) ((DEV|FV) ([0-9.]+))");
|
||||||
if (reg.indexIn(versionString) > -1) return reg.cap(2);
|
if (reg.indexIn(versionString) > -1) return reg.cap(2);
|
||||||
|
|
||||||
// parse version from output (other tools)
|
// parse version from output (other tools)
|
||||||
reg.setPattern("([A-Za-z_ ]+) ([0-9.]+)");
|
reg.setPattern("([A-Za-z_ ]+) ([0-9.]+)");
|
||||||
if (reg.indexIn(versionString) > -1) return reg.cap(2);
|
if (reg.indexIn(versionString) > -1) return reg.cap(2);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// try to parse version of executable in resources
|
// try to parse version of executable in resources
|
||||||
|
|
Loading…
Reference in a new issue