summaryrefslogtreecommitdiffstats
path: root/Meter.h
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2024-04-18 21:08:54 +0800
committerBenBE <BenBE@geshi.org>2024-04-20 19:36:00 +0200
commitfaaf6dd25e064f4e6e73061b15547b965b353ae5 (patch)
tree28f8e3a6e958302a29f75999039675264b9d5163 /Meter.h
parent52486dbc0f056c37b8cc81bf2f8c2830d77c7d52 (diff)
Obsolete the CUSTOM_METERMODE use in default mode
The use of CUSTOM_METERMODE value in meter default mode was a bad design. There are no meter that really has a "custom" mode to work with and currently that value serves as a useless placeholder that hides the real default mode for a meter. Replace CUSTOM_METERMODE in `defaultMode` of all meters with the real intended default modes. Currently only CPU meters and MemorySwapMeter used this, and their real defaults are BAR_METERMODE. In Meter_setMode(), remove the special treatment of `defaultMode == CUSTOM_METERMODE`, Meter_setMode() still calls the `updateMode` function for custom treatment when it's present for a meter class. As CUSTOM_METERMODE is obsolete from `defaultMode`, the init functions of CPU meters and MemorySwapMeter need to be adjusted to avoid incomplete initialization (Meter.draw function bring NULL). Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'Meter.h')
-rw-r--r--Meter.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/Meter.h b/Meter.h
index 17d77f3e..ce474da0 100644
--- a/Meter.h
+++ b/Meter.h
@@ -87,7 +87,6 @@ typedef struct MeterClass_ {
#define Meter_getUiName(this_,n_,l_) As_Meter(this_)->getUiName((const Meter*)(this_),n_,l_)
#define Meter_getCaptionFn(this_) As_Meter(this_)->getCaption
#define Meter_getCaption(this_) (Meter_getCaptionFn(this_) ? As_Meter(this_)->getCaption((const Meter*)(this_)) : (this_)->caption)
-#define Meter_defaultMode(this_) As_Meter(this_)->defaultMode
#define Meter_attributes(this_) As_Meter(this_)->attributes
#define Meter_name(this_) As_Meter(this_)->name
#define Meter_uiName(this_) As_Meter(this_)->uiName

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