DE (Linux): removes option slowVersionDetection

It's always true now

Fixes #2149
This commit is contained in:
李通洲
2026-01-19 10:55:30 +08:00
parent 461552b8d0
commit 70b4582bb6
3 changed files with 17 additions and 26 deletions
+16 -19
View File
@@ -44,7 +44,7 @@ static void getKDE(FFstrbuf* result, FFDEOptions* options)
if(result->length == 0)
ffParsePropFileData("wayland-sessions/plasmawayland5.desktop", "X-KDE-PluginInfo-Version =", result);
if(result->length == 0 && options->slowVersionDetection)
if(result->length == 0)
{
if (ffProcessAppendStdOut(result, (char* const[]){
"plasmashell",
@@ -73,7 +73,7 @@ static void getGnome(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
{
getGnomeByDbus(result);
if (result->length == 0 && options->slowVersionDetection)
if (result->length == 0)
{
if (ffProcessAppendStdOut(result, (char* const[]){
"gnome-shell",
@@ -91,7 +91,7 @@ static void getCinnamon(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
if (result->length == 0)
ffParsePropFileData("applications/cinnamon.desktop", "X-GNOME-Bugzilla-Version =", result);
if (result->length == 0 && options->slowVersionDetection)
if (result->length == 0)
{
if (ffProcessAppendStdOut(result, (char* const[]){
"cinnamon",
@@ -102,7 +102,7 @@ static void getCinnamon(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
}
}
static void getMate(FFstrbuf* result, FFDEOptions* options)
static void getMate(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
{
FF_STRBUF_AUTO_DESTROY major = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY minor = ffStrbufCreate();
@@ -116,7 +116,7 @@ static void getMate(FFstrbuf* result, FFDEOptions* options)
ffParseSemver(result, &major, &minor, &micro);
if(result->length == 0 && options->slowVersionDetection)
if(result->length == 0)
{
ffProcessAppendStdOut(result, (char* const[]){
"mate-session",
@@ -143,11 +143,11 @@ static const char* getXfce4ByLib(FFstrbuf* result)
#endif
}
static void getXFCE4(FFstrbuf* result, FFDEOptions* options)
static void getXFCE4(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
{
getXfce4ByLib(result);
if(result->length == 0 && options->slowVersionDetection)
if(result->length == 0)
{
//This is somewhat slow
ffProcessAppendStdOut(result, (char* const[]){
@@ -171,7 +171,7 @@ static void getLXQt(FFstrbuf* result, FFDEOptions* options)
if(result->length == 0)
ffParsePropFileData("cmake/lxqt/lxqt-config-version.cmake", "set ( PACKAGE_VERSION", result);
if(result->length == 0 && options->slowVersionDetection)
if(result->length == 0)
{
//This is really, really, really slow. Thank you, LXQt developers
ffProcessAppendStdOut(result, (char* const[]){
@@ -218,18 +218,15 @@ static const char* getTrinity(FFstrbuf* result, FFDEOptions* options)
if (ffBinaryExtractStrings(path.chars, extractTdeVersion, result, strlen("R0.0.0")) == NULL)
return NULL;
if (options->slowVersionDetection)
{
ffStrbufClear(&path);
ffProcessAppendStdOut(&path, (char* const[]){
"tde-config",
"--version",
NULL
});
ffStrbufClear(&path);
ffProcessAppendStdOut(&path, (char* const[]){
"tde-config",
"--version",
NULL
});
ffParsePropLines(path.chars , "TDE: ", result);
return NULL;
}
ffParsePropLines(path.chars , "TDE: ", result);
return NULL;
return "All methods failed";
}
+1 -5
View File
@@ -55,7 +55,7 @@ void ffParseDEJsonObject(FFDEOptions* options, yyjson_val* module)
if (unsafe_yyjson_equals_str(key, "slowVersionDetection"))
{
options->slowVersionDetection = yyjson_get_bool(val);
ffPrintError(FF_DE_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Key `slowVersionDetection` is deprecated, it's always true");
continue;
}
@@ -66,8 +66,6 @@ void ffParseDEJsonObject(FFDEOptions* options, yyjson_val* module)
void ffGenerateDEJsonConfig(FFDEOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
{
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
yyjson_mut_obj_add_bool(doc, module, "slowVersionDetection", options->slowVersionDetection);
}
bool ffGenerateDEJsonResult(FF_MAYBE_UNUSED FFDEOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
@@ -93,8 +91,6 @@ bool ffGenerateDEJsonResult(FF_MAYBE_UNUSED FFDEOptions* options, yyjson_mut_doc
void ffInitDEOptions(FFDEOptions* options)
{
ffOptionInitModuleArg(&options->moduleArgs, "");
options->slowVersionDetection = false;
}
void ffDestroyDEOptions(FFDEOptions* options)
-2
View File
@@ -5,8 +5,6 @@
typedef struct FFDEOptions
{
FFModuleArgs moduleArgs;
bool slowVersionDetection;
} FFDEOptions;
static_assert(sizeof(FFDEOptions) <= FF_OPTION_MAX_SIZE, "FFDEOptions size exceeds maximum allowed size");