From d6b0f49db29d0530798c0335074ba3913e8ea31f Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 22 Sep 2016 18:09:43 +0200 Subject: [PATCH] Changed: One second timeout to get version, see #279 --HG-- branch : develop --- .../client/ryzom_installer/src/utils.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index eef95553e..ac03abe90 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -260,17 +260,20 @@ QString getVersionFromExecutable(const QString &path) QByteArray data; // 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) - QRegExp reg("([A-Za-z0-1_.]+) ((DEV|FV) ([0-9.]+))"); - if (reg.indexIn(versionString) > -1) return reg.cap(2); + // parse version from output (client) + QRegExp reg("([A-Za-z0-1_.]+) ((DEV|FV) ([0-9.]+))"); + if (reg.indexIn(versionString) > -1) return reg.cap(2); - // parse version from output (other tools) - reg.setPattern("([A-Za-z_ ]+) ([0-9.]+)"); - if (reg.indexIn(versionString) > -1) return reg.cap(2); + // parse version from output (other tools) + reg.setPattern("([A-Za-z_ ]+) ([0-9.]+)"); + if (reg.indexIn(versionString) > -1) return reg.cap(2); + } #ifdef Q_OS_WIN // try to parse version of executable in resources