summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-13 12:30:00 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-13 12:30:00 +0100
commit9ad84605b66b0f96025bc93f6fe8933ae56e3961 (patch)
tree9dbe99eecd8cd75149f0604bb62a3aad56817d71
parentbad145f313451c47a3b67d1b6ca1b6e36469e654 (diff)
Revert "elm_config: fix elm_config_save not to wake idle processes up"
This reverts commit 8b0b9ed2819588fbf81299b784a600c6ac7ccd13. There have been issues with this commit, for further informations, please see https://phab.enlightenment.org/D7354 for more details.
-rw-r--r--src/lib/elementary/efl_ui_win.c1
-rw-r--r--src/lib/elementary/elm_config.c262
-rw-r--r--src/lib/elementary/elm_priv.h2
3 files changed, 89 insertions, 176 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 152eb1ce20..72188bf5f9 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1488,7 +1488,6 @@ _elm_win_profile_update(Efl_Ui_Win_Data *sd)
1488 1488
1489 _config_profile_lock = EINA_TRUE; 1489 _config_profile_lock = EINA_TRUE;
1490 _elm_config_profile_set(sd->profile.name); 1490 _elm_config_profile_set(sd->profile.name);
1491 _config_profile_lock = EINA_FALSE;
1492 1491
1493 /* update sub ee */ 1492 /* update sub ee */
1494 Ecore_Evas *ee2; 1493 Ecore_Evas *ee2;
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 7d7e85d438..12208dd2b9 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -5,8 +5,6 @@
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" 6#include "elm_priv.h"
7#include <pwd.h> 7#include <pwd.h>
8#include <fcntl.h>
9
10 8
11#include "efl_config_global.eo.h" 9#include "efl_config_global.eo.h"
12 10
@@ -36,7 +34,8 @@ static void _elm_config_key_binding_hash(void);
36Eina_Bool _config_profile_lock = EINA_FALSE; 34Eina_Bool _config_profile_lock = EINA_FALSE;
37static Ecore_Timer *_config_change_delay_timer = NULL; 35static Ecore_Timer *_config_change_delay_timer = NULL;
38static Ecore_Timer *_config_profile_change_delay_timer = NULL; 36static Ecore_Timer *_config_profile_change_delay_timer = NULL;
39static Ecore_Event_Handler *_monitor_file_modified_handler = NULL; 37static Ecore_Event_Handler *_monitor_file_created_handler = NULL;
38static Ecore_Event_Handler *_monitor_directory_created_handler = NULL;
40static Eio_Monitor *_eio_config_monitor = NULL; 39static Eio_Monitor *_eio_config_monitor = NULL;
41static Eio_Monitor *_eio_profile_monitor = NULL; 40static Eio_Monitor *_eio_profile_monitor = NULL;
42 41
@@ -190,7 +189,6 @@ static void _config_sub_apply(void);
190static void _config_update(void); 189static void _config_update(void);
191static void _env_get(void); 190static void _env_get(void);
192static void _color_overlays_cancel(void); 191static void _color_overlays_cancel(void);
193static Eina_Bool _file_touch(const char *file);
194 192
195#define ELM_CONFIG_VAL(edd, type, member, dtype) \ 193#define ELM_CONFIG_VAL(edd, type, member, dtype) \
196 EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype) 194 EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
@@ -1626,19 +1624,20 @@ _elm_recache(void)
1626} 1624}
1627 1625
1628static Elm_Config * 1626static Elm_Config *
1629_config_user_load(Eina_Bool on_flush) 1627_config_user_load(void)
1630{ 1628{
1631 Elm_Config *cfg = NULL; 1629 Elm_Config *cfg = NULL;
1632 Eet_File *ef; 1630 Eet_File *ef;
1633 char buf[PATH_MAX]; 1631 char buf[PATH_MAX];
1634 1632
1635 if (on_flush) 1633 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s",
1636 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", 1634 _elm_profile);
1637 _elm_profile); 1635 ecore_file_mkpath(buf);
1636 if (_eio_config_monitor) eio_monitor_del(_eio_config_monitor);
1637 _eio_config_monitor = eio_monitor_add(buf);
1638 1638
1639 if ((on_flush && !ecore_file_exists(buf)) || !on_flush) 1639 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
1640 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", 1640 _elm_profile);
1641 _elm_profile);
1642 1641
1643 ef = eet_open(buf, EET_FILE_MODE_READ); 1642 ef = eet_open(buf, EET_FILE_MODE_READ);
1644 if (ef) 1643 if (ef)
@@ -1691,7 +1690,7 @@ _efl_config_obj_del(Eo *obj EINA_UNUSED)
1691} 1690}
1692 1691
1693static void 1692static void
1694_config_load(Eina_Bool on_flush) 1693_config_load(void)
1695{ 1694{
1696 if (_efl_config_obj) 1695 if (_efl_config_obj)
1697 { 1696 {
@@ -1710,7 +1709,7 @@ _config_load(Eina_Bool on_flush)
1710 efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del); 1709 efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del);
1711 if (!_use_build_config) 1710 if (!_use_build_config)
1712 { 1711 {
1713 _elm_config = _config_user_load(on_flush); 1712 _elm_config = _config_user_load();
1714 if (_elm_config) 1713 if (_elm_config)
1715 { 1714 {
1716 if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH) 1715 if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH)
@@ -1880,13 +1879,13 @@ _config_load(Eina_Bool on_flush)
1880} 1879}
1881 1880
1882static void 1881static void
1883_elm_config_reload_do(Eina_Bool on_flush) 1882_elm_config_reload_do(void)
1884{ 1883{
1885 Elm_Config *prev_config; 1884 Elm_Config *prev_config;
1886 1885
1887 prev_config = _elm_config; 1886 prev_config = _elm_config;
1888 _elm_config = NULL; 1887 _elm_config = NULL;
1889 _config_load(on_flush); 1888 _config_load();
1890 if ((prev_config) && (_elm_config)) 1889 if ((prev_config) && (_elm_config))
1891 { 1890 {
1892#define KEEP_VAL(xxx) \ 1891#define KEEP_VAL(xxx) \
@@ -2107,7 +2106,7 @@ _config_flush_get(void)
2107 _elm_config_font_overlays_cancel(); 2106 _elm_config_font_overlays_cancel();
2108 _color_overlays_cancel(); 2107 _color_overlays_cancel();
2109 2108
2110 _elm_config_reload_do(EINA_TRUE); 2109 _elm_config_reload_do();
2111 2110
2112 /* restore prev value which is not part of the EET file */ 2111 /* restore prev value which is not part of the EET file */
2113 _elm_config->is_mirrored = is_mirrored; 2112 _elm_config->is_mirrored = is_mirrored;
@@ -2191,36 +2190,6 @@ _elm_config_eet_close_error_get(Eet_File *ef,
2191 return NULL; 2190 return NULL;
2192} 2191}
2193 2192
2194static char *
2195_elm_config_profile_name_get()
2196{
2197 char buf[PATH_MAX], *p;
2198 Eet_File *ef = NULL;
2199 int len = 0;
2200 char *rst = NULL;
2201
2202 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
2203
2204 ef = eet_open(buf, EET_FILE_MODE_READ);
2205 if (ef)
2206 {
2207 p = eet_read(ef, "config", &len);
2208 if (p)
2209 {
2210 rst = calloc(1, len+1);
2211 memcpy(rst, p, len);
2212 rst[len] = '\0';
2213 free(p);
2214 }
2215 eet_close(ef);
2216 }
2217
2218 if (rst)
2219 return rst;
2220 else
2221 return strdup("default");
2222}
2223
2224static Eina_Bool 2193static Eina_Bool
2225_elm_config_profile_save(const char *profile) 2194_elm_config_profile_save(const char *profile)
2226{ 2195{
@@ -2230,50 +2199,43 @@ _elm_config_profile_save(const char *profile)
2230 const char *err, *s; 2199 const char *err, *s;
2231 Eet_File *ef; 2200 Eet_File *ef;
2232 size_t len; 2201 size_t len;
2233 char *_file_profile = NULL;
2234 2202
2235 if ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s)) 2203 if ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s))
2236 return EINA_TRUE; 2204 return EINA_TRUE;
2237 2205
2238 _file_profile = _elm_config_profile_name_get(); 2206 len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
2239 2207 if (len + 1 >= sizeof(buf))
2240 if (!_file_profile || strcmp(_elm_profile, _file_profile)) 2208 return EINA_FALSE;
2241 {
2242 len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
2243 if (len + 1 >= sizeof(buf))
2244 return EINA_FALSE;
2245
2246 len = _elm_config_user_dir_snprintf(buf2, sizeof(buf2),
2247 "config/profile.cfg.tmp");
2248 if (len + 1 >= sizeof(buf2))
2249 return EINA_FALSE;
2250 2209
2251 ef = eet_open(buf2, EET_FILE_MODE_WRITE); 2210 len = _elm_config_user_dir_snprintf(buf2, sizeof(buf2),
2252 if (!ef) 2211 "config/profile.cfg.tmp");
2253 return EINA_FALSE; 2212 if (len + 1 >= sizeof(buf2))
2213 return EINA_FALSE;
2254 2214
2255 ok = eet_write(ef, "config", _elm_profile, strlen(_elm_profile), 0); 2215 ef = eet_open(buf2, EET_FILE_MODE_WRITE);
2256 if (!ok) 2216 if (!ef)
2257 goto err; 2217 return EINA_FALSE;
2258 2218
2259 err = _elm_config_eet_close_error_get(ef, buf2); 2219 ok = eet_write(ef, "config", _elm_profile, strlen(_elm_profile), 0);
2260 if (err) 2220 if (!ok)
2261 { 2221 goto err;
2262 ERR("%s", err);
2263 free((void *)err);
2264 goto err;
2265 }
2266 2222
2267 ret = ecore_file_cp(buf2, buf); 2223 err = _elm_config_eet_close_error_get(ef, buf2);
2268 if (!ret) 2224 if (err)
2269 { 2225 {
2270 ERR("Error saving Elementary's configuration profile file"); 2226 ERR("%s", err);
2271 goto err; 2227 free((void *)err);
2272 } 2228 goto err;
2229 }
2273 2230
2274 ecore_file_unlink(buf2); 2231 ret = ecore_file_cp(buf2, buf);
2232 if (!ret)
2233 {
2234 ERR("Error saving Elementary's configuration profile file");
2235 goto err;
2275 } 2236 }
2276 free(_file_profile); 2237
2238 ecore_file_unlink(buf2);
2277 2239
2278 derived = _elm_config_derived_load(profile ? profile : _elm_profile); 2240 derived = _elm_config_derived_load(profile ? profile : _elm_profile);
2279 if (derived) 2241 if (derived)
@@ -2595,10 +2557,10 @@ _env_get(void)
2595 eina_stringshare_replace(&_elm_config->engine, s); 2557 eina_stringshare_replace(&_elm_config->engine, s);
2596 else if ((!strcasecmp(s, "ews"))) 2558 else if ((!strcasecmp(s, "ews")))
2597 eina_stringshare_replace(&_elm_config->engine, ELM_EWS); 2559 eina_stringshare_replace(&_elm_config->engine, ELM_EWS);
2598 else if ((!strcasecmp(s, "wayland_shm")) || 2560 else if ((!strcasecmp(s, "wayland_shm")) ||
2599 (!strcasecmp(s, "wayland-shm"))) 2561 (!strcasecmp(s, "wayland-shm")))
2600 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_SHM); 2562 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_SHM);
2601 else if ((!strcasecmp(s, "wayland_egl")) || 2563 else if ((!strcasecmp(s, "wayland_egl")) ||
2602 (!strcasecmp(s, "wayland-egl"))) 2564 (!strcasecmp(s, "wayland-egl")))
2603 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_EGL); 2565 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_EGL);
2604 else if ((!strcasecmp(s, "drm"))) 2566 else if ((!strcasecmp(s, "drm")))
@@ -3106,7 +3068,7 @@ elm_config_save(void)
3106EAPI void 3068EAPI void
3107elm_config_reload(void) 3069elm_config_reload(void)
3108{ 3070{
3109 _elm_config_reload(EINA_FALSE); 3071 _elm_config_reload();
3110} 3072}
3111 3073
3112EAPI const char * 3074EAPI const char *
@@ -4245,10 +4207,9 @@ elm_config_popup_scrollable_set(Eina_Bool scrollable)
4245EAPI void 4207EAPI void
4246elm_config_all_flush(void) 4208elm_config_all_flush(void)
4247{ 4209{
4248 char buf[PATH_MAX], buf2[PATH_MAX]; 4210 char buf[PATH_MAX];
4249 int ok = 0; 4211 int ok = 0;
4250 size_t len; 4212 size_t len;
4251 Eet_File *ef = NULL;
4252 4213
4253 len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/"); 4214 len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/");
4254 if (len + 1 >= sizeof(buf)) 4215 if (len + 1 >= sizeof(buf))
@@ -4280,27 +4241,6 @@ elm_config_all_flush(void)
4280 return; 4241 return;
4281 } 4242 }
4282 4243
4283 _elm_config_user_dir_snprintf(buf, sizeof(buf),
4284 "config/%s/.base.flush.cfg.tmp", _elm_profile);
4285
4286 _elm_config_user_dir_snprintf(buf2, sizeof(buf2),
4287 "config/%s/.base.flush.cfg", _elm_profile);
4288
4289 ef = eet_open(buf, EET_FILE_MODE_WRITE);
4290 if (ef)
4291 {
4292 ok = eet_data_write(ef, _config_edd, "config", _elm_config, 1);
4293 if (!ok)
4294 {
4295 eet_close(ef);
4296 ERR("Failed to save config");
4297 return;
4298 }
4299 eet_close(ef);
4300 ecore_file_cp(buf, buf2);
4301 }
4302 ecore_file_unlink(buf);
4303
4304 elm_config_save(); 4244 elm_config_save();
4305 return; 4245 return;
4306} 4246}
@@ -4346,7 +4286,7 @@ _elm_config_init(void)
4346 _desc_init(); 4286 _desc_init();
4347 _elm_config_profile_derived_init(); 4287 _elm_config_profile_derived_init();
4348 _profile_fetch_from_conf(); 4288 _profile_fetch_from_conf();
4349 _config_load(EINA_FALSE); 4289 _config_load();
4350 if (_elm_config) _env_get(); 4290 if (_elm_config) _env_get();
4351 ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del); 4291 ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
4352 ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del); 4292 ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del);
@@ -4374,27 +4314,17 @@ _elm_config_sub_shutdown(void)
4374 ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del); 4314 ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del);
4375 ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del); 4315 ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del);
4376 ELM_SAFE_FREE(_config_profile_change_delay_timer, ecore_timer_del); 4316 ELM_SAFE_FREE(_config_profile_change_delay_timer, ecore_timer_del);
4377 ELM_SAFE_FREE(_monitor_file_modified_handler, ecore_event_handler_del); 4317 ELM_SAFE_FREE(_monitor_file_created_handler, ecore_event_handler_del);
4318 ELM_SAFE_FREE(_monitor_directory_created_handler, ecore_event_handler_del);
4378} 4319}
4379 4320
4380static Eina_Bool 4321static Eina_Bool
4381_config_profile_change_delay_cb(void *data EINA_UNUSED) 4322_config_profile_change_delay_cb(void *data EINA_UNUSED)
4382{ 4323{
4383 char *pprof = NULL; 4324 char *pprof = NULL;
4384 char buf[PATH_MAX];
4385 4325
4386 if (_elm_profile) pprof = strdup(_elm_profile); 4326 if (_elm_profile) pprof = strdup(_elm_profile);
4387 _profile_fetch_from_conf(); 4327 _profile_fetch_from_conf();
4388
4389 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile);
4390 if(!ecore_file_exists(buf)) _file_touch(buf);
4391
4392 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile);
4393 if(!ecore_file_exists(buf)) _file_touch(buf);
4394
4395 ELM_SAFE_FREE(_eio_config_monitor, eio_monitor_del);
4396 _eio_config_monitor = eio_monitor_add(buf);
4397
4398 if ((!pprof) || (!(!strcmp(pprof, _elm_profile)))) 4328 if ((!pprof) || (!(!strcmp(pprof, _elm_profile))))
4399 { 4329 {
4400 _config_flush_get(); 4330 _config_flush_get();
@@ -4407,7 +4337,7 @@ _config_profile_change_delay_cb(void *data EINA_UNUSED)
4407static Eina_Bool 4337static Eina_Bool
4408_config_change_delay_cb(void *data EINA_UNUSED) 4338_config_change_delay_cb(void *data EINA_UNUSED)
4409{ 4339{
4410 _elm_config_reload(EINA_TRUE); 4340 _elm_config_reload();
4411 4341
4412 _config_change_delay_timer = NULL; 4342 _config_change_delay_timer = NULL;
4413 return ECORE_CALLBACK_CANCEL; 4343 return ECORE_CALLBACK_CANCEL;
@@ -4423,21 +4353,42 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED,
4423 4353
4424 if (ev->monitor == _eio_config_monitor) 4354 if (ev->monitor == _eio_config_monitor)
4425 { 4355 {
4426 if (!strcmp(file, ".base.flush.cfg")) 4356 if (type == EIO_MONITOR_FILE_CREATED)
4427 { 4357 {
4428 if (_config_change_delay_timer) 4358 if (!strcmp(file, "base.cfg"))
4429 ecore_timer_del(_config_change_delay_timer); 4359 {
4430 _config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL); 4360 if (_config_change_delay_timer)
4361 ecore_timer_del(_config_change_delay_timer);
4362 _config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL);
4363 }
4431 } 4364 }
4432 } 4365 }
4433
4434 if (ev->monitor == _eio_profile_monitor) 4366 if (ev->monitor == _eio_profile_monitor)
4435 { 4367 {
4436 if (!strcmp(file, "profile.cfg")) 4368 if (type == EIO_MONITOR_FILE_CREATED)
4369 {
4370 if ((!_config_profile_lock) && (!strcmp(file, "profile.cfg")))
4371 {
4372 if (_config_profile_change_delay_timer)
4373 ecore_timer_del(_config_profile_change_delay_timer);
4374 _config_profile_change_delay_timer = ecore_timer_add(0.1, _config_profile_change_delay_cb, NULL);
4375 }
4376 }
4377 else if (type == EIO_MONITOR_DIRECTORY_CREATED)
4437 { 4378 {
4438 if (_config_profile_change_delay_timer) 4379 if (!_eio_config_monitor)
4439 ecore_timer_del(_config_profile_change_delay_timer); 4380 {
4440 _config_profile_change_delay_timer = ecore_timer_add(0.1, _config_profile_change_delay_cb, NULL); 4381 char buf[PATH_MAX];
4382
4383 _eio_config_monitor = eio_monitor_add(ev->filename);
4384 snprintf(buf, sizeof(buf), "%s/base.cfg", ev->filename);
4385 if (ecore_file_exists(buf))
4386 {
4387 if (_config_change_delay_timer)
4388 ecore_timer_del(_config_change_delay_timer);
4389 _config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL);
4390 }
4391 }
4441 } 4392 }
4442 } 4393 }
4443 4394
@@ -4464,29 +4415,18 @@ _elm_config_sub_init(void)
4464 buf); 4415 buf);
4465 goto end; 4416 goto end;
4466 } 4417 }
4467
4468 _elm_config_profile_save(NULL);
4469
4470 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
4471 if(!ecore_file_exists(buf)) _file_touch(buf);
4472 _eio_profile_monitor = eio_monitor_add(buf); 4418 _eio_profile_monitor = eio_monitor_add(buf);
4473 4419 _monitor_file_created_handler = ecore_event_handler_add
4474 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile); 4420 (EIO_MONITOR_FILE_CREATED, _elm_config_file_monitor_cb, NULL);
4475 if(!ecore_file_exists(buf)) _file_touch(buf); 4421 _monitor_directory_created_handler = ecore_event_handler_add
4476 4422 (EIO_MONITOR_DIRECTORY_CREATED, _elm_config_file_monitor_cb, NULL);
4477 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile);
4478 if(!ecore_file_exists(buf)) _file_touch(buf);
4479 _eio_config_monitor = eio_monitor_add(buf);
4480
4481 _monitor_file_modified_handler = ecore_event_handler_add
4482 (EIO_MONITOR_FILE_MODIFIED, _elm_config_file_monitor_cb, NULL);
4483 4423
4484end: 4424end:
4485 _config_sub_apply(); 4425 _config_sub_apply();
4486} 4426}
4487 4427
4488void 4428void
4489_elm_config_reload(Eina_Bool on_flush) 4429_elm_config_reload(void)
4490{ 4430{
4491 Eina_Bool is_mirrored; 4431 Eina_Bool is_mirrored;
4492 Eina_Bool translate; 4432 Eina_Bool translate;
@@ -4520,8 +4460,8 @@ _elm_config_reload(Eina_Bool on_flush)
4520 is_mirrored = _elm_config->is_mirrored; 4460 is_mirrored = _elm_config->is_mirrored;
4521 translate = _elm_config->translate; 4461 translate = _elm_config->translate;
4522 4462
4523 _elm_config_reload_do(on_flush); 4463 _elm_config_reload_do();
4524 4464
4525 /* restore prev value which is not part of the EET file */ 4465 /* restore prev value which is not part of the EET file */
4526 _elm_config->is_mirrored = is_mirrored; 4466 _elm_config->is_mirrored = is_mirrored;
4527 _elm_config->translate = translate; 4467 _elm_config->translate = translate;
@@ -4806,7 +4746,6 @@ _elm_config_profile_set(const char *profile)
4806 Eina_Bool translate; 4746 Eina_Bool translate;
4807 is_mirrored = _elm_config->is_mirrored; 4747 is_mirrored = _elm_config->is_mirrored;
4808 translate = _elm_config->translate; 4748 translate = _elm_config->translate;
4809 char buf[PATH_MAX];
4810 4749
4811 if (!profile) return; 4750 if (!profile) return;
4812 4751
@@ -4820,15 +4759,9 @@ _elm_config_profile_set(const char *profile)
4820 4759
4821 _elm_profile = strdup(profile); 4760 _elm_profile = strdup(profile);
4822 4761
4823 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile);
4824 if(!ecore_file_exists(buf)) _file_touch(buf);
4825
4826 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile);
4827 if(!ecore_file_exists(buf)) _file_touch(buf);
4828
4829 _color_overlays_cancel(); 4762 _color_overlays_cancel();
4830 4763
4831 _elm_config_reload_do(EINA_FALSE); 4764 _elm_config_reload_do();
4832 4765
4833 /* restore prev value which is not part of the EET file */ 4766 /* restore prev value which is not part of the EET file */
4834 _elm_config->is_mirrored = is_mirrored; 4767 _elm_config->is_mirrored = is_mirrored;
@@ -5392,25 +5325,6 @@ EOLIAN static void
5392_efl_config_global_profile_derived_del(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile) 5325_efl_config_global_profile_derived_del(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile)
5393{ 5326{
5394 elm_config_profile_derived_del(profile); 5327 elm_config_profile_derived_del(profile);
5395
5396}
5397static Eina_Bool
5398_file_touch(const char *file)
5399{
5400 if (!file) return EINA_FALSE;
5401
5402 const char *dir = ecore_file_dir_get(file);
5403 if(!dir) return EINA_FALSE;
5404 if(!ecore_file_mkpath(dir)) return EINA_FALSE;
5405
5406 Eo *f = efl_add_ref(EFL_IO_FILE_CLASS, NULL,
5407 efl_file_set(efl_added, file, NULL),
5408 efl_io_file_flags_set(efl_added, O_CREAT|O_RDWR),
5409 efl_io_file_mode_set(efl_added, 0644));
5410 if (!f) return EINA_FALSE;
5411 efl_unref(f);
5412
5413 return EINA_TRUE;
5414} 5328}
5415 5329
5416#include "efl_config_global.eo.c" 5330#include "efl_config_global.eo.c"
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 1e268dd68a..cd0a987615 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -644,7 +644,7 @@ void _elm_config_sub_init(void);
644void _elm_config_shutdown(void); 644void _elm_config_shutdown(void);
645void _elm_config_sub_shutdown(void); 645void _elm_config_sub_shutdown(void);
646Eina_Bool _elm_config_save(Elm_Config *cfg, const char *profile); 646Eina_Bool _elm_config_save(Elm_Config *cfg, const char *profile);
647void _elm_config_reload(Eina_Bool on_flush); 647void _elm_config_reload(void);
648size_t _elm_config_user_dir_snprintf(char *dst, size_t size, 648size_t _elm_config_user_dir_snprintf(char *dst, size_t size,
649 const char *fmt, ...) 649 const char *fmt, ...)
650 EINA_PRINTF(3, 4); 650 EINA_PRINTF(3, 4);