mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 14:10:11 +01:00
Unified method for testing if c strings contain a value
This commit is contained in:
@@ -155,7 +155,7 @@ static bool printCursorFromEnv(FFinstance* instance)
|
||||
{
|
||||
const char* xcursor_theme = getenv("XCURSOR_THEME");
|
||||
|
||||
if(xcursor_theme == NULL || *xcursor_theme == '\0')
|
||||
if(!ffStrSet(xcursor_theme))
|
||||
return false;
|
||||
|
||||
FFstrbuf theme;
|
||||
|
||||
@@ -64,7 +64,7 @@ static void printWMThemeFromSettings(FFinstance* instance, const char* dconfKey,
|
||||
{
|
||||
const char* theme = ffSettingsGet(instance, dconfKey, gsettingsSchemaName, gsettingsPath, gsettingsKey, FF_VARIANT_TYPE_STRING).strValue;
|
||||
|
||||
if(theme == NULL || *theme == '\0')
|
||||
if(!ffStrSet(theme))
|
||||
{
|
||||
ffPrintError(instance, FF_WMTHEME_MODULE_NAME, 0, &instance->config.wmThemeKey, &instance->config.wmThemeFormat, FF_WMTHEME_NUM_FORMAT_ARGS, "Couldn't find WM theme in DConf or GSettings");
|
||||
return;
|
||||
@@ -105,7 +105,7 @@ static void printGTKThemeAsWMTheme(FFinstance* instance)
|
||||
static void printMutter(FFinstance* instance)
|
||||
{
|
||||
const char* theme = ffSettingsGet(instance, "/org/gnome/shell/extensions/user-theme/name", "org.gnome.shell.extensions.user-theme", NULL, "name", FF_VARIANT_TYPE_STRING).strValue;
|
||||
if(theme != NULL && *theme != '\0')
|
||||
if(ffStrSet(theme))
|
||||
{
|
||||
printWMTheme(instance, theme);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user