Settings: create default meters on no existing config file

If htop is started for the first time and no configuration file exists
the header is empty cause no meters are added as a default.

Add the default meters if parsing all available configuration paths
failed.
This commit is contained in:
Christian Göttsche 2021-08-28 17:57:51 +02:00 committed by BenBE
parent 74f99e3693
commit becd33795c
1 changed files with 3 additions and 0 deletions

View File

@ -543,6 +543,9 @@ Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicColumns)
this->changed = true; this->changed = true;
Settings_read(this, SYSCONFDIR "/htoprc", initialCpuCount); Settings_read(this, SYSCONFDIR "/htoprc", initialCpuCount);
} }
if (!ok) {
Settings_defaultMeters(this, initialCpuCount);
}
return this; return this;
} }