From ffcdbf20f52029ebf456b91cbe2be9ab07b90b07 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 10 Jun 2014 00:16:08 +0200 Subject: [PATCH] config: always create a themes directory for user. This make it more logical as it is part of Elementary config, so it should be elementary duty to create that directory. @fix --- legacy/elementary/src/lib/elm_config.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/legacy/elementary/src/lib/elm_config.c b/legacy/elementary/src/lib/elm_config.c index e3c8db6333..68edc0822a 100644 --- a/legacy/elementary/src/lib/elm_config.c +++ b/legacy/elementary/src/lib/elm_config.c @@ -1434,6 +1434,16 @@ _config_user_load(void) cfg = eet_data_read(ef, _config_edd, "config"); eet_close(ef); } + + if (cfg) + { + size_t len; + + len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/"); + if (len + 1 < sizeof(buf)) + ecore_file_mkpath(buf); + } + return cfg; } @@ -1717,6 +1727,18 @@ _elm_config_save(void) Eet_File *ef; size_t len; + len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/"); + if (len + 1 >= sizeof(buf)) + return EINA_FALSE; + + ok = ecore_file_mkpath(buf); + if (!ok) + { + ERR("Problem accessing Elementary's user configuration directory: %s", + buf); + return EINA_FALSE; + } + len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s", _elm_profile); if (len + 1 >= sizeof(buf))