| 1528 | } |
| 1529 | |
| 1530 | void Backend::dismissAutoUpdatePrompt() |
| 1531 | { |
| 1532 | // Set flag in config |
| 1533 | QString configPath = crConfigDir() + "/config.json"; |
| 1534 | QJsonObject obj; |
| 1535 | |
| 1536 | QFile f(configPath); |
| 1537 | if (f.open(QIODevice::ReadOnly)) { |
| 1538 | QJsonDocument doc = QJsonDocument::fromJson(f.readAll()); |
| 1539 | f.close(); |
| 1540 | if (doc.isObject()) obj = doc.object(); |
| 1541 | } |
| 1542 | |
| 1543 | obj["auto_update_prompted"] = true; |
| 1544 | |
| 1545 | QDir().mkpath(crConfigDir()); |
| 1546 | QString tempPath = configPath + ".tmp"; |
| 1547 | QFile tmp(tempPath); |
| 1548 | if (tmp.open(QIODevice::WriteOnly)) { |
| 1549 | tmp.write(QJsonDocument(obj).toJson()); |
| 1550 | tmp.close(); |
| 1551 | if (!QFile::rename(tempPath, configPath)) { |
| 1552 | QFile::remove(configPath); |
| 1553 | QFile::rename(tempPath, configPath); |
| 1554 | } |
| 1555 | } |
| 1556 | } |
| 1557 | |
| 1558 | static QString runFlatpakHostCommand(const QStringList &args, int timeoutMs = 15000) |
| 1559 | { |
nothing calls this directly
no test coverage detected