mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Global: remove --allow-slow-operations
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
typedef struct FFOptionsGeneral
|
||||
{
|
||||
bool allowSlowOperations;
|
||||
bool multithreading;
|
||||
int32_t processingTimeout;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user