From 47089bb99a2c691db40abb1548ae4bd49714f352 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 28 Jan 2018 16:56:55 -0200 Subject: [PATCH] htoprc: store screen 0's setup for improved compatibility --- Settings.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Settings.c b/Settings.c index 9f61a73..918aa4c 100644 --- a/Settings.c +++ b/Settings.c @@ -455,6 +455,13 @@ bool Settings_write(Settings* this) { fprintf(fd, "left_meter_modes="); writeMeterModes(this, fd, 0); fprintf(fd, "right_meters="); writeMeters(this, fd, 1); fprintf(fd, "right_meter_modes="); writeMeterModes(this, fd, 1); + + // Legacy compatibility with older versions of htop + fprintf(fd, "tree_view=%d\n", (int) this->screens[0]->treeView); + // This "-1" is for compatibility with the older enum format. + fprintf(fd, "sort_key=%d\n", (int) this->screens[0]->sortKey-1); + fprintf(fd, "sort_direction=%d\n", (int) this->screens[0]->direction); + if (this->nPlugins > 0) { fprintf(fd, "plugins="); writeList(fd, this->plugins, this->nPlugins); } -- GitLab