mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 04:04:35 +03:00
Improving Command display/sort
This commit is contained in:

committed by
BenBE

parent
42c842c190
commit
09fe94da18
@ -416,6 +416,10 @@ void Process_done(Process* this) {
|
||||
free(this->comm);
|
||||
}
|
||||
|
||||
static const char* Process_getCommandStr(const Process* p) {
|
||||
return p->comm ? p->comm : "";
|
||||
}
|
||||
|
||||
const ProcessClass Process_class = {
|
||||
.super = {
|
||||
.extends = Class(Object),
|
||||
@ -424,6 +428,7 @@ const ProcessClass Process_class = {
|
||||
.compare = Process_compare
|
||||
},
|
||||
.writeField = Process_writeField,
|
||||
.getCommandStr = Process_getCommandStr,
|
||||
};
|
||||
|
||||
void Process_init(Process* this, const struct Settings_* settings) {
|
||||
@ -503,7 +508,7 @@ long Process_compare(const void* v1, const void* v2) {
|
||||
case PERCENT_MEM:
|
||||
return SPACESHIP_NUMBER(p2->m_resident, p1->m_resident);
|
||||
case COMM:
|
||||
return SPACESHIP_NULLSTR(p1->comm, p2->comm);
|
||||
return SPACESHIP_NULLSTR(Process_getCommand(p1), Process_getCommand(p2));
|
||||
case MAJFLT:
|
||||
return SPACESHIP_NUMBER(p2->majflt, p1->majflt);
|
||||
case MINFLT:
|
||||
|
Reference in New Issue
Block a user