diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c561d93b..ae397c3ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ This release introduces a new option `--migrate-config`, which migrates old flag Changes: * `--pipe` and `--stat` are moved from `general` options to `display` options. This affects cjson configuration. -* Display keys `percent*` and `size*` in JSON config are restructured. `{ "sizeNdigits": 1 }` is now `{ "size": { "ndigits": 1 } }` +* Display keys `percent*` and `size*` in JSON config are restructured. e.g. `{ "sizeNdigits": 1 }` is now `{ "size": { "ndigits": 1 } }` * With the introduction of `--migrate-config`, the old flag based config file is deprecated, and will be removed in 3.0.0 (next major version) * Support of `--gen-config conf` is deprecated accordingly, and will be removed in 2.3.0 (next minor version) * The global flag `--allow-slow-operations` is splitted into some explicit flags in differnet modules diff --git a/doc/json_schema.json b/doc/json_schema.json index 9a9e1d1e9..5a3d2ccd9 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -227,11 +227,6 @@ "title": "Fastfetch general configurations", "type": "object", "properties": { - "allowSlowOperations": { - "type": "boolean", - "title": "Allow operations that can be very slow for more detailed output", - "default": false - }, "multithreading": { "type": "boolean", "title": "Use multiple threads to detect values", diff --git a/src/options/general.c b/src/options/general.c index f4d1895a1..6357e04b8 100644 --- a/src/options/general.c +++ b/src/options/general.c @@ -17,9 +17,7 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va { const char* key = yyjson_get_str(key_); - if (ffStrEqualsIgnCase(key, "allowSlowOperations")) - options->allowSlowOperations = yyjson_get_bool(val); - else if (ffStrEqualsIgnCase(key, "thread") || ffStrEqualsIgnCase(key, "multithreading")) + if (ffStrEqualsIgnCase(key, "thread") || ffStrEqualsIgnCase(key, "multithreading")) options->multithreading = yyjson_get_bool(val); else if (ffStrEqualsIgnCase(key, "processingTimeout")) options->processingTimeout = (int32_t) yyjson_get_int(val); @@ -42,6 +40,8 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va return "Property `general.stat` has been changed to `display.stat`"; else if (ffStrEqualsIgnCase(key, "pipe")) return "Property `general.pipe` has been changed to `display.pipe`"; + else if (ffStrEqualsIgnCase(key, "allowSlowOperations")) + return "Property `general.allowSlowOperations` has been obsoleted. See CHANGELOG for detail"; else return "Unknown general property"; @@ -52,9 +52,7 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va bool ffOptionsParseGeneralCommandLine(FFOptionsGeneral* options, const char* key, const char* value) { - if(ffStrEqualsIgnCase(key, "--allow-slow-operations")) - options->allowSlowOperations = ffOptionParseBoolean(value); - else if(ffStrEqualsIgnCase(key, "--thread") || ffStrEqualsIgnCase(key, "--multithreading")) + if(ffStrEqualsIgnCase(key, "--thread") || ffStrEqualsIgnCase(key, "--multithreading")) options->multithreading = ffOptionParseBoolean(value); else if(ffStrEqualsIgnCase(key, "--processing-timeout")) options->processingTimeout = ffOptionParseInt32(key, value); @@ -82,7 +80,6 @@ bool ffOptionsParseGeneralCommandLine(FFOptionsGeneral* options, const char* key void ffOptionsInitGeneral(FFOptionsGeneral* options) { options->processingTimeout = 1000; - options->allowSlowOperations = false; options->multithreading = true; #if defined(__linux__) || defined(__FreeBSD__) @@ -110,9 +107,6 @@ void ffOptionsGenerateGeneralJsonConfig(FFOptionsGeneral* options, yyjson_mut_do yyjson_mut_val* obj = yyjson_mut_obj(doc); - if (options->allowSlowOperations != defaultOptions.allowSlowOperations) - yyjson_mut_obj_add_bool(doc, obj, "allowSlowOperations", options->allowSlowOperations); - if (options->multithreading != defaultOptions.multithreading) yyjson_mut_obj_add_bool(doc, obj, "thread", options->multithreading); diff --git a/src/options/general.h b/src/options/general.h index cb57719d2..156991028 100644 --- a/src/options/general.h +++ b/src/options/general.h @@ -4,7 +4,6 @@ typedef struct FFOptionsGeneral { - bool allowSlowOperations; bool multithreading; int32_t processingTimeout;