From 67edfd7f59be0039582cbceceda2f7f348755190 Mon Sep 17 00:00:00 2001 From: DarN Date: Mon, 17 May 2021 11:10:56 +0200 Subject: [PATCH] Added more file checks --- src/common/detectWMDE.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/detectWMDE.c b/src/common/detectWMDE.c index 5c2dd61f5..bb6d85d51 100644 --- a/src/common/detectWMDE.c +++ b/src/common/detectWMDE.c @@ -282,7 +282,12 @@ 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); + ffParsePropFile("/usr/lib/pkgconfig/lxqt.pc", "Version:", &result->deVersion); + + if(result->deVersion.length == 0) + ffParsePropFile("/usr/share/cmake/lxqt/lxqt-config.cmake", "set ( LXQT_VERSION", &result->deVersion); + if(result->deVersion.length == 0) + ffParsePropFile("/usr/share/cmake/lxqt/lxqt-config-version.cmake", "set ( PACKAGE_VERSION", &result->deVersion); if(result->deVersion.length == 0 && instance->config.allowSlowOperations) { @@ -293,10 +298,8 @@ static void getLXQt(FFinstance* instance, FFWMDEResult* result) NULL }); - FF_STRBUF_CREATE(tmp); - ffGetPropValueFromLines(result->deVersion.chars , "liblxqt", &tmp); - ffStrbufSet(&result->deVersion, &tmp); - ffStrbufDestroy(&tmp); + result->deVersion.length = 0; //don't set '\0' byte + ffGetPropValueFromLines(result->deVersion.chars , "liblxqt", &result->deVersion); } }