MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / dismissAutoUpdatePrompt

Method dismissAutoUpdatePrompt

ui-linux/src/backend.cpp:1530–1556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1528}
1529
1530void 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
1558static QString runFlatpakHostCommand(const QStringList &args, int timeoutMs = 15000)
1559{

Callers

nothing calls this directly

Calls 1

crConfigDirFunction · 0.85

Tested by

no test coverage detected