mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Battery (Windows): removes option useSetupApi
This commit is contained in:
@@ -1540,11 +1540,6 @@
|
||||
"const": "battery",
|
||||
"description": "Print battery information"
|
||||
},
|
||||
"useSetupApi": {
|
||||
"description": "Whether to use the `CM API` on Windows to detect battery information. Supports multiple batteries, but is slower (Windows only)",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"temp": {
|
||||
"$ref": "#/$defs/temperature"
|
||||
},
|
||||
|
||||
@@ -202,13 +202,6 @@ void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module) {
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if (unsafe_yyjson_equals_str(key, "useSetupApi")) {
|
||||
options->useSetupApi = yyjson_get_bool(val);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ffTempsParseJsonObject(key, val, &options->temp, &options->tempConfig)) {
|
||||
continue;
|
||||
}
|
||||
@@ -224,10 +217,6 @@ void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module) {
|
||||
void ffGenerateBatteryJsonConfig(FFBatteryOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) {
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
|
||||
|
||||
#ifdef _WIN32
|
||||
yyjson_mut_obj_add_bool(doc, module, "useSetupApi", options->useSetupApi);
|
||||
#endif
|
||||
|
||||
ffTempsGenerateJsonConfig(doc, module, options->temp, options->tempConfig);
|
||||
ffPercentGenerateJsonConfig(doc, module, options->percent);
|
||||
}
|
||||
@@ -302,10 +291,6 @@ void ffInitBatteryOptions(FFBatteryOptions* options) {
|
||||
options->temp = false;
|
||||
options->tempConfig = (FFColorRangeConfig) { 60, 80 };
|
||||
options->percent = (FFPercentageModuleConfig) { 50, 20, 0 };
|
||||
|
||||
#ifdef _WIN32
|
||||
options->useSetupApi = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ffDestroyBatteryOptions(FFBatteryOptions* options) {
|
||||
|
||||
@@ -9,10 +9,6 @@ typedef struct FFBatteryOptions {
|
||||
bool temp;
|
||||
FFColorRangeConfig tempConfig;
|
||||
FFPercentageModuleConfig percent;
|
||||
|
||||
#ifdef _WIN32
|
||||
bool useSetupApi;
|
||||
#endif
|
||||
} FFBatteryOptions;
|
||||
|
||||
static_assert(sizeof(FFBatteryOptions) <= FF_OPTION_MAX_SIZE, "FFBatteryOptions size exceeds maximum allowed size");
|
||||
|
||||
Reference in New Issue
Block a user