Skip to content

Commit 62b8693

Browse files
committed
Use Qx::execute() for AM exe version
1 parent 4e7b716 commit 62b8693

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ endif()
7474

7575
include(OB/FetchQx)
7676
ob_fetch_qx(
77-
REF "66ccfeff2eddd912fff7e0116539bbfe84e9503c"
77+
REF "f98cb3e3af74af09d277b4a45c414a5f22aef4f3"
7878
COMPONENTS
7979
${FIL_QX_COMPONENTS}
8080
)

app/src/launcher/implementation/attractmode/am-install_linux.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// Qx Includes
55
#include <qx/core/qx-regularexpression.h>
6+
#include <qx/core/qx-system.h>
67

78
namespace Am
89
{
@@ -12,24 +13,8 @@ namespace Am
1213

1314
QString Install::versionFromExecutable() const
1415
{
15-
QProcess attract;
16-
attract.setProgram(MAIN_EXE_PATH);
17-
attract.setArguments({"--version"});
18-
19-
attract.start();
20-
if(!attract.waitForStarted(1000))
21-
return QString();
22-
23-
if(!attract.waitForFinished(1000))
24-
{
25-
attract.kill(); // Force close
26-
attract.waitForFinished();
27-
28-
return QString();
29-
}
30-
31-
QString versionInfo = QString::fromLatin1(attract.readAllStandardOutput());
32-
QRegularExpressionMatch sv = Qx::RegularExpression::SEMANTIC_VERSION.match(versionInfo);
16+
ExecuteResult res = Qx::execute(MAIN_EXE_PATH, {"--version"}, 1000);
17+
QRegularExpressionMatch sv = Qx::RegularExpression::SEMANTIC_VERSION.match(res.output);
3318
return sv.hasMatch() ? sv.captured() : QString();
3419
}
3520

0 commit comments

Comments
 (0)