Global: remove --allow-slow-operations

This commit is contained in:
李通洲
2023-10-31 14:10:21 +08:00
parent c504096181
commit b99f444234
4 changed files with 5 additions and 17 deletions
+1 -1
View File
@@ -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
-5
View File
@@ -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",
+4 -10
View File
@@ -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);
-1
View File
@@ -4,7 +4,6 @@
typedef struct FFOptionsGeneral
{
bool allowSlowOperations;
bool multithreading;
int32_t processingTimeout;