params: code cleanup (#22744)

* cleanup params

* apply review

* continue

* use c_str

* cleanup filelock

* don't check return code of close()

* remove call_once

* cleanup params_pyx

* cleanup comment
old-commit-hash: 2773ff5aceb8874a9319c819ec3707705a00604d
This commit is contained in:
Dean Lee
2021-11-01 18:22:34 +08:00
committed by GitHub
parent e2e7e68978
commit 40b2bb9f65
4 changed files with 54 additions and 150 deletions
+1 -2
View File
@@ -227,8 +227,7 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) {
fs_watch = new QFileSystemWatcher(this);
QObject::connect(fs_watch, &QFileSystemWatcher::fileChanged, [=](const QString path) {
int update_failed_count = params.get<int>("UpdateFailedCount").value_or(0);
if (path.contains("UpdateFailedCount") && update_failed_count > 0) {
if (path.contains("UpdateFailedCount") && std::atoi(params.get("UpdateFailedCount").c_str()) > 0) {
lastUpdateLbl->setText("failed to fetch update");
updateBtn->setText("CHECK");
updateBtn->setEnabled(true);