fix: column index desync after reorder
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 33s
Rust / build (pull_request) Successful in 48s
Python / verify (pull_request) Successful in 1m42s
Rust / fmt (pull_request) Successful in 26s
Rust / clippy (pull_request) Successful in 45s

This commit is contained in:
2026-09-27 22:47:31 +02:00
parent 9ea1f846ae
commit cc9aeca98b
28 changed files with 859 additions and 464 deletions
+10 -54
View File
@@ -1,11 +1,7 @@
#include "tickingservice.hpp"
#include <QFile>
#include <QDir>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QFileSystemWatcher>
#include <QTimer>
#include "config/dashboard.hpp"
#include "config/rootnodes.hpp"
namespace ZShell::services {
@@ -17,53 +13,13 @@ TickingService::TickingService(QObject* parent)
updateTriggered();
});
QString configPath =
QDir::homePath() + QStringLiteral("/.config/zshell/config.json");
auto reloadConfig = [this, configPath]() {
QFile file(configPath);
if (!file.open(QIODevice::ReadOnly)) {
return;
}
QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
if (doc.isNull()) {
return;
}
QJsonObject dashboard = doc.object().value("dashboard").toObject();
if (dashboard.contains("resourceUpdateInterval")) {
applyInterval(
dashboard.value("resourceUpdateInterval").toInt(1000));
}
};
reloadConfig();
static auto* watcher = new QFileSystemWatcher();
if (!watcher->files().contains(configPath)) {
QObject::connect(
watcher,
&QFileSystemWatcher::fileChanged,
this,
[this, configPath]() {
QTimer::singleShot(100, this, [this, configPath]() {
QFile file(configPath);
if (!file.open(QIODevice::ReadOnly)) {
return;
}
QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
if (doc.isNull()) {
return;
}
QJsonObject dashboard =
doc.object().value("dashboard").toObject();
if (dashboard.contains("resourceUpdateInterval")) {
applyInterval(dashboard.value("resourceUpdateInterval")
.toInt(1000));
}
});
});
watcher->addPath(configPath);
}
auto* dash = ZShell::config::ConfigSingleton::instance()->dashboard();
applyInterval(dash->resourceUpdateInterval());
QObject::connect(
dash,
&ZShell::config::Dashboard::resourceUpdateIntervalChanged,
this,
[this, dash] { applyInterval(dash->resourceUpdateInterval()); });
}
int TickingService::updateInterval() const {