From 82674a7d14ed5a15b42418108b92c1ef11fd19a7 Mon Sep 17 00:00:00 2001 From: DarN Date: Mon, 17 May 2021 06:34:48 +0200 Subject: [PATCH] Rewrote with fast and slow modes --- src/common/detectWMDE.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/detectWMDE.c b/src/common/detectWMDE.c index a146ca5c3..5c2dd61f5 100644 --- a/src/common/detectWMDE.c +++ b/src/common/detectWMDE.c @@ -282,18 +282,21 @@ static void getLXQt(FFinstance* instance, FFWMDEResult* result) { ffStrbufSetS(&result->deProcessName, "lxqt-session"); ffStrbufSetS(&result->dePrettyName, "LXQt"); + ffParsePropFile("/usr/share/cmake/lxqt/lxqt-config.cmake", "set(LXQT_VERSION", &result->deVersion); - if(instance->config.allowSlowOperations) + if(result->deVersion.length == 0 && instance->config.allowSlowOperations) { - //This is really, really, reaaaally slow. Thank you, LXQt developers + //This is really, really, really slow. Thank you, LXQt developers ffProcessAppendStdOut(&result->deVersion, (char* const[]){ "lxqt-session", "-v", NULL }); - ffStrbufSubstrAfter(&result->deVersion, result->deProcessName.length); - ffStrbufSubstrBefore(&result->deVersion, 6); //X.XX.X + FF_STRBUF_CREATE(tmp); + ffGetPropValueFromLines(result->deVersion.chars , "liblxqt", &tmp); + ffStrbufSet(&result->deVersion, &tmp); + ffStrbufDestroy(&tmp); } }