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
+29
View File
@@ -75,6 +75,16 @@ class ProcessModel : public QAbstractListModel {
void sortAscendingChanged();
private:
struct FuzzyCacheEntry {
quint64 starttime = 0;
QString command;
QString commandChars;
QVector<quint8> commandClasses;
QString commandLineChars;
QVector<quint8> commandLineClasses;
bool hasCommandLine = false;
};
struct RawStat {
pid_t pid = 0;
pid_t ppid = 0;
@@ -116,6 +126,18 @@ class ProcessModel : public QAbstractListModel {
quint64 writeBytes = 0;
};
struct ScanContext {
double uptime = 0.0;
double deltaSecs = -1.0;
const QHash<pid_t, int>* prevPidToAll = nullptr;
const QVector<ProcessEntry>* prevAll = nullptr;
long clockTicksPerSec = 100;
const QHash<QString, QString>* execPathToIcon = nullptr;
const QHash<QString, QString>* execNameToIcon = nullptr;
bool iconsChanged = false;
uid_t selfEuid = 0;
};
struct ScanResult {
QVector<ProcessEntry> entries;
QHash<uid_t, QString> newUidNames;
@@ -130,6 +152,12 @@ class ProcessModel : public QAbstractListModel {
static QString resolveUsername(uid_t uid, QHash<uid_t, QString>& cache);
static QString resolveProcessExe(pid_t pid);
static void scanChunk(
const ScanContext& ctx,
const QVector<pid_t>& pids,
QVector<ProcessEntry>& out,
QHash<uid_t, QString>& uidCache);
static ScanResult scanProcesses(
double uptime,
double deltaSecs,
@@ -153,6 +181,7 @@ class ProcessModel : public QAbstractListModel {
QVector<ProcessEntry> mAll;
QHash<pid_t, int> mPidToAll;
QHash<pid_t, FuzzyCacheEntry> mFuzzyCache;
QVector<ProcessEntry> mProcesses;
QHash<uid_t, QString> mUidToName;