From 88d2530460f63d0af680bbbb4ddab4bb786ccffa Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sun, 2 May 2021 21:30:05 +0200 Subject: [PATCH] better transforming from gsettings to dconf --- src/common/gsettings.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/gsettings.c b/src/common/gsettings.c index 298815f6f..d495030b9 100644 --- a/src/common/gsettings.c +++ b/src/common/gsettings.c @@ -40,12 +40,15 @@ static const char* getDConfValue(DConfData* data, const char* schemaName, const ffStrbufInitA(&dconfStyleKey, 64); ffStrbufAppendC(&dconfStyleKey, '/'); ffStrbufAppendTransformS(&dconfStyleKey, schemaName, transformGSettingsToDConf); - ffStrbufAppendC(&dconfStyleKey, '/'); - if(path != NULL && *path != '\0') - { - ffStrbufAppendTransformS(&dconfStyleKey, path, transformGSettingsToDConf); + + if(path == NULL || *path != '/') ffStrbufAppendC(&dconfStyleKey, '/'); - } + + ffStrbufAppendTransformS(&dconfStyleKey, path, transformGSettingsToDConf); + + if(path != NULL && dconfStyleKey.chars[dconfStyleKey.length - 1] != '/') + ffStrbufAppendC(&dconfStyleKey, '/'); + ffStrbufAppendS(&dconfStyleKey, key); GVariant* variant = data->ffdconf_client_read_full(data->client, dconfStyleKey.chars, DCONF_READ_FLAGS_NONE, NULL);