From f2ce4862ccbab6e0d9e854a1c7403cd0614d2fa6 Mon Sep 17 00:00:00 2001 From: zach Date: Mon, 28 Sep 2026 13:14:48 +0200 Subject: [PATCH] chore: formatter --- Plugins/ZShell/Llm/chat.cpp | 3 ++- Plugins/ZShell/Services/memory.cpp | 15 +++++++-------- Plugins/ZShell/Services/processes.cpp | 19 ++++++++++--------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Plugins/ZShell/Llm/chat.cpp b/Plugins/ZShell/Llm/chat.cpp index b819d28..6c2b4d2 100644 --- a/Plugins/ZShell/Llm/chat.cpp +++ b/Plugins/ZShell/Llm/chat.cpp @@ -193,7 +193,8 @@ void Chat::refreshFromServer() { void Chat::selectModel(const QString& id) { if (id.isEmpty()) return; m_client->setModel(id); - if (auto* config = config::ConfigSingleton::instance()) config->llm()->set_model(id); + if (auto* config = config::ConfigSingleton::instance()) + config->llm()->set_model(id); } } // namespace ZShell::llm diff --git a/Plugins/ZShell/Services/memory.cpp b/Plugins/ZShell/Services/memory.cpp index 1b1c2b9..07e9c55 100644 --- a/Plugins/ZShell/Services/memory.cpp +++ b/Plugins/ZShell/Services/memory.cpp @@ -45,8 +45,7 @@ void Memory::tick() { QStringLiteral("MemTotal: *(\\d+)")); static const QRegularExpression reAvail( QStringLiteral("MemAvailable: *(\\d+)")); - static const QRegularExpression reCached(QStringLiteral( - "Cached: *(\\d+)")); + static const QRegularExpression reCached(QStringLiteral("Cached: *(\\d+)")); const QString text = QString::fromLatin1(data); const auto totalMatch = reTotal.match(text); @@ -78,14 +77,14 @@ void Memory::tick() { const auto pgin = rePgin.match(vtext); const auto pgout = rePgout.match(vtext); if (pgin.hasMatch()) { - readKib = static_cast(static_cast( - pgin.captured(1).toULongLong()) * - pageKib); + readKib = static_cast( + static_cast(pgin.captured(1).toULongLong()) * + pageKib); } if (pgout.hasMatch()) { - writeKib = static_cast(static_cast( - pgout.captured(1).toULongLong()) * - pageKib); + writeKib = static_cast( + static_cast(pgout.captured(1).toULongLong()) * + pageKib); } } } diff --git a/Plugins/ZShell/Services/processes.cpp b/Plugins/ZShell/Services/processes.cpp index 96cef22..5b926a4 100644 --- a/Plugins/ZShell/Services/processes.cpp +++ b/Plugins/ZShell/Services/processes.cpp @@ -793,8 +793,7 @@ void ProcessModel::scanChunk( nowTicks > prevTicks ? nowTicks - prevTicks : 0; entry.cpuPercent = (static_cast(deltaTicks) / - (ctx.deltaSecs * - static_cast(ctx.clockTicksPerSec))) * + (ctx.deltaSecs * static_cast(ctx.clockTicksPerSec))) * 100.0; } else { entry.cpuPercent = 0.0; @@ -839,7 +838,8 @@ ProcessModel::ScanResult ProcessModel::scanProcesses( // syscall-bound (open/read/close per file per process) and serializes // badly on large systems. Keep one pool thread free for this function, // which itself runs inside the global pool. - int nThreads = qMin(16, QThreadPool::globalInstance()->maxThreadCount() - 1); + int nThreads = + qMin(16, QThreadPool::globalInstance()->maxThreadCount() - 1); if (pids.size() < 128 || nThreads < 2) { nThreads = 1; } @@ -860,8 +860,8 @@ ProcessModel::ScanResult ProcessModel::scanProcesses( continue; } chunks[t] = pids.mid(a, b - a); - futures.append(QtConcurrent::run( - [&ctx, &chunks, &outs, &uidParts, t]() { + futures.append( + QtConcurrent::run([&ctx, &chunks, &outs, &uidParts, t]() { scanChunk(ctx, chunks[t], outs[t], uidParts[t]); })); } @@ -880,8 +880,9 @@ ProcessModel::ScanResult ProcessModel::scanProcesses( } } std::sort( - fresh.begin(), fresh.end(), [](const ProcessEntry& a, - const ProcessEntry& b) { + fresh.begin(), + fresh.end(), + [](const ProcessEntry& a, const ProcessEntry& b) { return a.pid < b.pid; }); } @@ -1012,8 +1013,8 @@ void ProcessModel::applyView() { const FuzzyText prep = fuzzyPrepare(src.command); fe.commandChars = std::move(prep.chars); fe.commandClasses = std::move(prep.classes); - fe.hasCommandLine = - !src.commandLine.isEmpty() && src.commandLine != src.command; + fe.hasCommandLine = !src.commandLine.isEmpty() && + src.commandLine != src.command; if (fe.hasCommandLine) { const FuzzyText prepCl = fuzzyPrepare(src.commandLine); fe.commandLineChars = std::move(prepCl.chars);