summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-11-18 06:08:56 +0000
committerHisham Muhammad <hisham@gobolinux.org>2011-11-18 06:08:56 +0000
commit7ca10817122d3b7b30fabb1cadb75e5ee14b364e (patch)
tree14fa282dcad8eac9401fa463484b0b1693f43e1f /Settings.c
parent38856488815711138aa9d0ba32cca66694717171 (diff)
Mega-commit with features and tweaks for 1.0:
* Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels.
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Settings.c b/Settings.c
index 3daf3c11..816a7ecb 100644
--- a/Settings.c
+++ b/Settings.c
@@ -55,7 +55,7 @@ static void Settings_readMeterModes(Settings* this, char* line, HeaderSide side)
String_freeArray(ids);
}
-static bool Settings_read(Settings* this, char* fileName) {
+static bool Settings_read(Settings* this, char* fileName, int cpuCount) {
// TODO: implement File object and make
// file I/O object-oriented.
FILE* fd;
@@ -144,7 +144,7 @@ static bool Settings_read(Settings* this, char* fileName) {
}
fclose(fd);
if (!readMeters) {
- Header_defaultMeters(this->header);
+ Header_defaultMeters(this->header, cpuCount);
}
return true;
}
@@ -208,7 +208,7 @@ bool Settings_write(Settings* this) {
return true;
}
-Settings* Settings_new(ProcessList* pl, Header* header) {
+Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
Settings* this = malloc(sizeof(Settings));
this->pl = pl;
this->header = header;
@@ -225,15 +225,15 @@ Settings* Settings_new(ProcessList* pl, Header* header) {
this->colorScheme = 0;
this->changed = false;
this->delay = DEFAULT_DELAY;
- bool ok = Settings_read(this, this->userSettings);
+ bool ok = Settings_read(this, this->userSettings, cpuCount);
if (!ok) {
this->changed = true;
// TODO: how to get SYSCONFDIR correctly through Autoconf?
char* systemSettings = String_cat(SYSCONFDIR, "/htoprc");
- ok = Settings_read(this, systemSettings);
+ ok = Settings_read(this, systemSettings, cpuCount);
free(systemSettings);
if (!ok) {
- Header_defaultMeters(this->header);
+ Header_defaultMeters(this->header, cpuCount);
pl->hideKernelThreads = true;
pl->highlightMegabytes = true;
pl->highlightThreads = false;

© 2014-2024 Faster IT GmbH | imprint | privacy policy