mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +00:00
lutris: avoid lingering process on import timeout
This commit is contained in:
parent
2285de6b1e
commit
6080962cf9
1 changed files with 9 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ QList<Game *> LutrisImporter::importGames()
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.start(lutrisPath, {QStringLiteral("-lo"), QStringLiteral("--json")});
|
process.start(lutrisPath, {QStringLiteral("-lo"), QStringLiteral("--json")});
|
||||||
|
|
||||||
if (process.waitForFinished(30000)) {
|
if (process.waitForStarted(5000) && process.waitForFinished(30000)) {
|
||||||
QByteArray output = process.readAllStandardOutput();
|
QByteArray output = process.readAllStandardOutput();
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(output);
|
QJsonDocument doc = QJsonDocument::fromJson(output);
|
||||||
|
|
||||||
|
|
@ -139,6 +139,14 @@ QList<Game *> LutrisImporter::importGames()
|
||||||
Q_EMIT importProgress(current, total);
|
Q_EMIT importProgress(current, total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (process.state() != QProcess::NotRunning) {
|
||||||
|
process.terminate();
|
||||||
|
if (!process.waitForFinished(3000)) {
|
||||||
|
process.kill();
|
||||||
|
process.waitForFinished(3000);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue