summaryrefslogtreecommitdiffstats
path: root/DynamicMeter.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-04-04 16:24:37 +1000
committerBenBE <BenBE@geshi.org>2023-04-06 00:19:54 +0200
commite7f447b6a3473a572d3e6c191128f1796477860d (patch)
tree1e8a90d216055dfe77b688fc48c0a42f18637d71 /DynamicMeter.c
parentc8a61850dd31ab64eb8ad83929ce86d2adbeb96c (diff)
Refactor and consolidate dynamic meters/columns pointers
This removes the duplication of dynamic meter/column hashtable pointers that has come in between the Settings and ProcessList structures - only one copy of these is needed. With the future planned dynamic screens feature adding another pointer, let us first clean this up before any further duplication happens.
Diffstat (limited to 'DynamicMeter.c')
-rw-r--r--DynamicMeter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/DynamicMeter.c b/DynamicMeter.c
index a8cd76cc..40c06bb6 100644
--- a/DynamicMeter.c
+++ b/DynamicMeter.c
@@ -88,16 +88,16 @@ static void DynamicMeter_display(const Object* cast, RichString* out) {
}
static const char* DynamicMeter_getCaption(const Meter* this) {
- const ProcessList* pl = this->pl;
- const DynamicMeter* meter = Hashtable_get(pl->dynamicMeters, this->param);
+ const Settings* settings = this->pl->settings;
+ const DynamicMeter* meter = Hashtable_get(settings->dynamicMeters, this->param);
if (meter)
return meter->caption ? meter->caption : meter->name;
return this->caption;
}
static void DynamicMeter_getUiName(const Meter* this, char* name, size_t length) {
- const ProcessList* pl = this->pl;
- const DynamicMeter* meter = Hashtable_get(pl->dynamicMeters, this->param);
+ const Settings* settings = this->pl->settings;
+ const DynamicMeter* meter = Hashtable_get(settings->dynamicMeters, this->param);
if (meter) {
const char* uiName = meter->caption;
if (uiName) {

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