Hold only a const version of Settings in Process

This commit is contained in:
Christian Göttsche
2020-10-21 21:26:05 +02:00
committed by cgzones
parent 7109172431
commit 4eb443926f
20 changed files with 28 additions and 28 deletions

View File

@ -69,11 +69,11 @@ ProcessPidColumn Process_pidColumns[] = {
{ .id = 0, .label = NULL },
};
FreeBSDProcess* FreeBSDProcess_new(Settings* settings) {
Process* FreeBSDProcess_new(const Settings* settings) {
FreeBSDProcess* this = xCalloc(1, sizeof(FreeBSDProcess));
Object_setClass(this, Class(FreeBSDProcess));
Process_init(&this->super, settings);
return this;
return &this->super;
}
void Process_delete(Object* cast) {

View File

@ -39,7 +39,7 @@ extern ProcessFieldData Process_fields[];
extern ProcessPidColumn Process_pidColumns[];
FreeBSDProcess* FreeBSDProcess_new(Settings* settings);
Process* FreeBSDProcess_new(const Settings* settings);
void Process_delete(Object* cast);

View File

@ -401,7 +401,7 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) {
struct kinfo_proc* kproc = &kprocs[i];
bool preExisting = false;
// TODO: bool isIdleProcess = false;
Process* proc = ProcessList_getProcess(this, kproc->ki_pid, &preExisting, (Process_New) FreeBSDProcess_new);
Process* proc = ProcessList_getProcess(this, kproc->ki_pid, &preExisting, FreeBSDProcess_new);
FreeBSDProcess* fp = (FreeBSDProcess*) proc;
proc->show = ! ((hideKernelThreads && Process_isKernelThread(fp)) || (hideUserlandThreads && Process_isUserlandThread(proc)));