Skip to content

Commit 70b4582

Browse files
committed
DE (Linux): removes option slowVersionDetection
It's always true now Fixes #2149
1 parent 461552b commit 70b4582

3 files changed

Lines changed: 17 additions & 26 deletions

File tree

src/detection/de/de_linux.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static void getKDE(FFstrbuf* result, FFDEOptions* options)
4444
if(result->length == 0)
4545
ffParsePropFileData("wayland-sessions/plasmawayland5.desktop", "X-KDE-PluginInfo-Version =", result);
4646

47-
if(result->length == 0 && options->slowVersionDetection)
47+
if(result->length == 0)
4848
{
4949
if (ffProcessAppendStdOut(result, (char* const[]){
5050
"plasmashell",
@@ -73,7 +73,7 @@ static void getGnome(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
7373
{
7474
getGnomeByDbus(result);
7575

76-
if (result->length == 0 && options->slowVersionDetection)
76+
if (result->length == 0)
7777
{
7878
if (ffProcessAppendStdOut(result, (char* const[]){
7979
"gnome-shell",
@@ -91,7 +91,7 @@ static void getCinnamon(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
9191
if (result->length == 0)
9292
ffParsePropFileData("applications/cinnamon.desktop", "X-GNOME-Bugzilla-Version =", result);
9393

94-
if (result->length == 0 && options->slowVersionDetection)
94+
if (result->length == 0)
9595
{
9696
if (ffProcessAppendStdOut(result, (char* const[]){
9797
"cinnamon",
@@ -102,7 +102,7 @@ static void getCinnamon(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
102102
}
103103
}
104104

105-
static void getMate(FFstrbuf* result, FFDEOptions* options)
105+
static void getMate(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
106106
{
107107
FF_STRBUF_AUTO_DESTROY major = ffStrbufCreate();
108108
FF_STRBUF_AUTO_DESTROY minor = ffStrbufCreate();
@@ -116,7 +116,7 @@ static void getMate(FFstrbuf* result, FFDEOptions* options)
116116

117117
ffParseSemver(result, &major, &minor, &micro);
118118

119-
if(result->length == 0 && options->slowVersionDetection)
119+
if(result->length == 0)
120120
{
121121
ffProcessAppendStdOut(result, (char* const[]){
122122
"mate-session",
@@ -143,11 +143,11 @@ static const char* getXfce4ByLib(FFstrbuf* result)
143143
#endif
144144
}
145145

146-
static void getXFCE4(FFstrbuf* result, FFDEOptions* options)
146+
static void getXFCE4(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
147147
{
148148
getXfce4ByLib(result);
149149

150-
if(result->length == 0 && options->slowVersionDetection)
150+
if(result->length == 0)
151151
{
152152
//This is somewhat slow
153153
ffProcessAppendStdOut(result, (char* const[]){
@@ -171,7 +171,7 @@ static void getLXQt(FFstrbuf* result, FFDEOptions* options)
171171
if(result->length == 0)
172172
ffParsePropFileData("cmake/lxqt/lxqt-config-version.cmake", "set ( PACKAGE_VERSION", result);
173173

174-
if(result->length == 0 && options->slowVersionDetection)
174+
if(result->length == 0)
175175
{
176176
//This is really, really, really slow. Thank you, LXQt developers
177177
ffProcessAppendStdOut(result, (char* const[]){
@@ -218,18 +218,15 @@ static const char* getTrinity(FFstrbuf* result, FFDEOptions* options)
218218
if (ffBinaryExtractStrings(path.chars, extractTdeVersion, result, strlen("R0.0.0")) == NULL)
219219
return NULL;
220220

221-
if (options->slowVersionDetection)
222-
{
223-
ffStrbufClear(&path);
224-
ffProcessAppendStdOut(&path, (char* const[]){
225-
"tde-config",
226-
"--version",
227-
NULL
228-
});
221+
ffStrbufClear(&path);
222+
ffProcessAppendStdOut(&path, (char* const[]){
223+
"tde-config",
224+
"--version",
225+
NULL
226+
});
229227

230-
ffParsePropLines(path.chars , "TDE: ", result);
231-
return NULL;
232-
}
228+
ffParsePropLines(path.chars , "TDE: ", result);
229+
return NULL;
233230

234231
return "All methods failed";
235232
}

src/modules/de/de.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void ffParseDEJsonObject(FFDEOptions* options, yyjson_val* module)
5555

5656
if (unsafe_yyjson_equals_str(key, "slowVersionDetection"))
5757
{
58-
options->slowVersionDetection = yyjson_get_bool(val);
58+
ffPrintError(FF_DE_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Key `slowVersionDetection` is deprecated, it's always true");
5959
continue;
6060
}
6161

@@ -66,8 +66,6 @@ void ffParseDEJsonObject(FFDEOptions* options, yyjson_val* module)
6666
void ffGenerateDEJsonConfig(FFDEOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
6767
{
6868
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
69-
70-
yyjson_mut_obj_add_bool(doc, module, "slowVersionDetection", options->slowVersionDetection);
7169
}
7270

7371
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
9391
void ffInitDEOptions(FFDEOptions* options)
9492
{
9593
ffOptionInitModuleArg(&options->moduleArgs, "");
96-
97-
options->slowVersionDetection = false;
9894
}
9995

10096
void ffDestroyDEOptions(FFDEOptions* options)

src/modules/de/option.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
typedef struct FFDEOptions
66
{
77
FFModuleArgs moduleArgs;
8-
9-
bool slowVersionDetection;
108
} FFDEOptions;
119

1210
static_assert(sizeof(FFDEOptions) <= FF_OPTION_MAX_SIZE, "FFDEOptions size exceeds maximum allowed size");

0 commit comments

Comments
 (0)