elm_config: fix elm_config_save not to wake idle processes up
there is a eio_monitor which is tracking on config directory. and that is the reason why idle processes get waken up once some process call elm_config_save(). this patch fix the function not to wake idle processes up as it was before. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7354
This commit is contained in:
parent
43b18dc890
commit
8b0b9ed281
|
@ -1485,6 +1485,7 @@ _elm_win_profile_update(Efl_Ui_Win_Data *sd)
|
||||||
|
|
||||||
_config_profile_lock = EINA_TRUE;
|
_config_profile_lock = EINA_TRUE;
|
||||||
_elm_config_profile_set(sd->profile.name);
|
_elm_config_profile_set(sd->profile.name);
|
||||||
|
_config_profile_lock = EINA_FALSE;
|
||||||
|
|
||||||
/* update sub ee */
|
/* update sub ee */
|
||||||
Ecore_Evas *ee2;
|
Ecore_Evas *ee2;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
|
||||||
#include "efl_config_global.eo.h"
|
#include "efl_config_global.eo.h"
|
||||||
|
|
||||||
|
@ -34,8 +36,7 @@ static void _elm_config_key_binding_hash(void);
|
||||||
Eina_Bool _config_profile_lock = EINA_FALSE;
|
Eina_Bool _config_profile_lock = EINA_FALSE;
|
||||||
static Ecore_Timer *_config_change_delay_timer = NULL;
|
static Ecore_Timer *_config_change_delay_timer = NULL;
|
||||||
static Ecore_Timer *_config_profile_change_delay_timer = NULL;
|
static Ecore_Timer *_config_profile_change_delay_timer = NULL;
|
||||||
static Ecore_Event_Handler *_monitor_file_created_handler = NULL;
|
static Ecore_Event_Handler *_monitor_file_modified_handler = NULL;
|
||||||
static Ecore_Event_Handler *_monitor_directory_created_handler = NULL;
|
|
||||||
static Eio_Monitor *_eio_config_monitor = NULL;
|
static Eio_Monitor *_eio_config_monitor = NULL;
|
||||||
static Eio_Monitor *_eio_profile_monitor = NULL;
|
static Eio_Monitor *_eio_profile_monitor = NULL;
|
||||||
|
|
||||||
|
@ -188,6 +189,7 @@ static void _config_sub_apply(void);
|
||||||
static void _config_update(void);
|
static void _config_update(void);
|
||||||
static void _env_get(void);
|
static void _env_get(void);
|
||||||
static void _color_overlays_cancel(void);
|
static void _color_overlays_cancel(void);
|
||||||
|
static Eina_Bool _file_touch(const char *file);
|
||||||
|
|
||||||
#define ELM_CONFIG_VAL(edd, type, member, dtype) \
|
#define ELM_CONFIG_VAL(edd, type, member, dtype) \
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
|
||||||
|
@ -1617,18 +1619,17 @@ _elm_recache(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Elm_Config *
|
static Elm_Config *
|
||||||
_config_user_load(void)
|
_config_user_load(Eina_Bool on_flush)
|
||||||
{
|
{
|
||||||
Elm_Config *cfg = NULL;
|
Elm_Config *cfg = NULL;
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s",
|
if (on_flush)
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg",
|
||||||
_elm_profile);
|
_elm_profile);
|
||||||
ecore_file_mkpath(buf);
|
|
||||||
if (_eio_config_monitor) eio_monitor_del(_eio_config_monitor);
|
|
||||||
_eio_config_monitor = eio_monitor_add(buf);
|
|
||||||
|
|
||||||
|
if (!ecore_file_exists(buf) || !on_flush)
|
||||||
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
|
||||||
_elm_profile);
|
_elm_profile);
|
||||||
|
|
||||||
|
@ -1683,7 +1684,7 @@ _efl_config_obj_del(Eo *obj EINA_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_config_load(void)
|
_config_load(Eina_Bool on_flush)
|
||||||
{
|
{
|
||||||
if (_efl_config_obj)
|
if (_efl_config_obj)
|
||||||
{
|
{
|
||||||
|
@ -1702,7 +1703,7 @@ _config_load(void)
|
||||||
efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del);
|
efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del);
|
||||||
if (!_use_build_config)
|
if (!_use_build_config)
|
||||||
{
|
{
|
||||||
_elm_config = _config_user_load();
|
_elm_config = _config_user_load(on_flush);
|
||||||
if (_elm_config)
|
if (_elm_config)
|
||||||
{
|
{
|
||||||
if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH)
|
if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH)
|
||||||
|
@ -1871,13 +1872,13 @@ _config_load(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_elm_config_reload_do(void)
|
_elm_config_reload_do(Eina_Bool on_flush)
|
||||||
{
|
{
|
||||||
Elm_Config *prev_config;
|
Elm_Config *prev_config;
|
||||||
|
|
||||||
prev_config = _elm_config;
|
prev_config = _elm_config;
|
||||||
_elm_config = NULL;
|
_elm_config = NULL;
|
||||||
_config_load();
|
_config_load(on_flush);
|
||||||
if ((prev_config) && (_elm_config))
|
if ((prev_config) && (_elm_config))
|
||||||
{
|
{
|
||||||
#define KEEP_VAL(xxx) \
|
#define KEEP_VAL(xxx) \
|
||||||
|
@ -2096,7 +2097,7 @@ _config_flush_get(void)
|
||||||
_elm_config_font_overlays_cancel();
|
_elm_config_font_overlays_cancel();
|
||||||
_color_overlays_cancel();
|
_color_overlays_cancel();
|
||||||
|
|
||||||
_elm_config_reload_do();
|
_elm_config_reload_do(EINA_TRUE);
|
||||||
|
|
||||||
/* restore prev value which is not part of the EET file */
|
/* restore prev value which is not part of the EET file */
|
||||||
_elm_config->is_mirrored = is_mirrored;
|
_elm_config->is_mirrored = is_mirrored;
|
||||||
|
@ -2180,6 +2181,35 @@ _elm_config_eet_close_error_get(Eet_File *ef,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_elm_config_profile_name_get()
|
||||||
|
{
|
||||||
|
char buf[PATH_MAX], *p, *s;
|
||||||
|
Eet_File *ef = NULL;
|
||||||
|
int len = 0, i;
|
||||||
|
char *rst = NULL;
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
|
||||||
|
|
||||||
|
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||||
|
if (ef)
|
||||||
|
{
|
||||||
|
p = eet_read(ef, "config", &len);
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
rst = calloc(1, len+1);
|
||||||
|
memcpy(rst, p, len);
|
||||||
|
rst[len] = '\0';
|
||||||
|
}
|
||||||
|
eet_close(ef);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rst)
|
||||||
|
return rst;
|
||||||
|
else
|
||||||
|
return strdup("default");
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_elm_config_profile_save(const char *profile)
|
_elm_config_profile_save(const char *profile)
|
||||||
{
|
{
|
||||||
|
@ -2189,10 +2219,15 @@ _elm_config_profile_save(const char *profile)
|
||||||
const char *err, *s;
|
const char *err, *s;
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
char *_file_profile = NULL;
|
||||||
|
|
||||||
if ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s))
|
if ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s))
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
|
_file_profile = _elm_config_profile_name_get();
|
||||||
|
|
||||||
|
if (!_file_profile || strcmp(_elm_profile, _file_profile))
|
||||||
|
{
|
||||||
len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
|
len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
|
||||||
if (len + 1 >= sizeof(buf))
|
if (len + 1 >= sizeof(buf))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -2226,6 +2261,8 @@ _elm_config_profile_save(const char *profile)
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_file_unlink(buf2);
|
ecore_file_unlink(buf2);
|
||||||
|
}
|
||||||
|
free(_file_profile);
|
||||||
|
|
||||||
derived = _elm_config_derived_load(profile ? profile : _elm_profile);
|
derived = _elm_config_derived_load(profile ? profile : _elm_profile);
|
||||||
if (derived)
|
if (derived)
|
||||||
|
@ -3051,7 +3088,7 @@ elm_config_save(void)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_config_reload(void)
|
elm_config_reload(void)
|
||||||
{
|
{
|
||||||
_elm_config_reload();
|
_elm_config_reload(EINA_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -4190,9 +4227,10 @@ elm_config_popup_scrollable_set(Eina_Bool scrollable)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_config_all_flush(void)
|
elm_config_all_flush(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX], buf2[PATH_MAX];
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
Eet_File *ef = NULL;
|
||||||
|
|
||||||
len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/");
|
len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/");
|
||||||
if (len + 1 >= sizeof(buf))
|
if (len + 1 >= sizeof(buf))
|
||||||
|
@ -4224,6 +4262,27 @@ elm_config_all_flush(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf),
|
||||||
|
"config/%s/.base.flush.cfg.tmp", _elm_profile);
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf2, sizeof(buf2),
|
||||||
|
"config/%s/.base.flush.cfg", _elm_profile);
|
||||||
|
|
||||||
|
ef = eet_open(buf, EET_FILE_MODE_WRITE);
|
||||||
|
if (ef)
|
||||||
|
{
|
||||||
|
ok = eet_data_write(ef, _config_edd, "config", _elm_config, 1);
|
||||||
|
if (!ok)
|
||||||
|
{
|
||||||
|
eet_close(ef);
|
||||||
|
ERR("Failed to save config");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
eet_close(ef);
|
||||||
|
ecore_file_cp(buf, buf2);
|
||||||
|
}
|
||||||
|
ecore_file_unlink(buf);
|
||||||
|
|
||||||
elm_config_save();
|
elm_config_save();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4269,7 +4328,7 @@ _elm_config_init(void)
|
||||||
_desc_init();
|
_desc_init();
|
||||||
_elm_config_profile_derived_init();
|
_elm_config_profile_derived_init();
|
||||||
_profile_fetch_from_conf();
|
_profile_fetch_from_conf();
|
||||||
_config_load();
|
_config_load(EINA_FALSE);
|
||||||
if (_elm_config) _env_get();
|
if (_elm_config) _env_get();
|
||||||
ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
|
ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
|
||||||
ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del);
|
ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del);
|
||||||
|
@ -4297,17 +4356,27 @@ _elm_config_sub_shutdown(void)
|
||||||
ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del);
|
ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del);
|
||||||
ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del);
|
ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del);
|
||||||
ELM_SAFE_FREE(_config_profile_change_delay_timer, ecore_timer_del);
|
ELM_SAFE_FREE(_config_profile_change_delay_timer, ecore_timer_del);
|
||||||
ELM_SAFE_FREE(_monitor_file_created_handler, ecore_event_handler_del);
|
ELM_SAFE_FREE(_monitor_file_modified_handler, ecore_event_handler_del);
|
||||||
ELM_SAFE_FREE(_monitor_directory_created_handler, ecore_event_handler_del);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_config_profile_change_delay_cb(void *data EINA_UNUSED)
|
_config_profile_change_delay_cb(void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
char *pprof = NULL;
|
char *pprof = NULL;
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
if (_elm_profile) pprof = strdup(_elm_profile);
|
if (_elm_profile) pprof = strdup(_elm_profile);
|
||||||
_profile_fetch_from_conf();
|
_profile_fetch_from_conf();
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile);
|
||||||
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile);
|
||||||
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
|
|
||||||
|
ELM_SAFE_FREE(_eio_config_monitor, eio_monitor_del);
|
||||||
|
_eio_config_monitor = eio_monitor_add(buf);
|
||||||
|
|
||||||
if ((!pprof) || (!(!strcmp(pprof, _elm_profile))))
|
if ((!pprof) || (!(!strcmp(pprof, _elm_profile))))
|
||||||
{
|
{
|
||||||
_config_flush_get();
|
_config_flush_get();
|
||||||
|
@ -4320,7 +4389,7 @@ _config_profile_change_delay_cb(void *data EINA_UNUSED)
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_config_change_delay_cb(void *data EINA_UNUSED)
|
_config_change_delay_cb(void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
_elm_config_reload();
|
_elm_config_reload(EINA_TRUE);
|
||||||
|
|
||||||
_config_change_delay_timer = NULL;
|
_config_change_delay_timer = NULL;
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
|
@ -4337,42 +4406,23 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED,
|
||||||
|
|
||||||
if (ev->monitor == _eio_config_monitor)
|
if (ev->monitor == _eio_config_monitor)
|
||||||
{
|
{
|
||||||
if (type == EIO_MONITOR_FILE_CREATED)
|
if (!strcmp(file, ".base.flush.cfg"))
|
||||||
{
|
|
||||||
if (!strcmp(file, "base.cfg"))
|
|
||||||
{
|
{
|
||||||
if (_config_change_delay_timer)
|
if (_config_change_delay_timer)
|
||||||
ecore_timer_del(_config_change_delay_timer);
|
ecore_timer_del(_config_change_delay_timer);
|
||||||
_config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL);
|
_config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (ev->monitor == _eio_profile_monitor)
|
if (ev->monitor == _eio_profile_monitor)
|
||||||
{
|
{
|
||||||
if (type == EIO_MONITOR_FILE_CREATED)
|
if (!strcmp(file, "profile.cfg"))
|
||||||
{
|
|
||||||
if ((!_config_profile_lock) && (!strcmp(file, "profile.cfg")))
|
|
||||||
{
|
{
|
||||||
if (_config_profile_change_delay_timer)
|
if (_config_profile_change_delay_timer)
|
||||||
ecore_timer_del(_config_profile_change_delay_timer);
|
ecore_timer_del(_config_profile_change_delay_timer);
|
||||||
_config_profile_change_delay_timer = ecore_timer_add(0.1, _config_profile_change_delay_cb, NULL);
|
_config_profile_change_delay_timer = ecore_timer_add(0.1, _config_profile_change_delay_cb, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == EIO_MONITOR_DIRECTORY_CREATED)
|
|
||||||
{
|
|
||||||
if (!_eio_config_monitor)
|
|
||||||
{
|
|
||||||
_eio_config_monitor = eio_monitor_add(ev->filename);
|
|
||||||
snprintf(buf, sizeof(buf), "%s/base.cfg", ev->filename);
|
|
||||||
if (ecore_file_exists(buf))
|
|
||||||
{
|
|
||||||
if (_config_change_delay_timer)
|
|
||||||
ecore_timer_del(_config_change_delay_timer);
|
|
||||||
_config_change_delay_timer = ecore_timer_add(0.1, _config_change_delay_cb, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
@ -4397,18 +4447,29 @@ _elm_config_sub_init(void)
|
||||||
buf);
|
buf);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_elm_config_profile_save(NULL);
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
|
||||||
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
_eio_profile_monitor = eio_monitor_add(buf);
|
_eio_profile_monitor = eio_monitor_add(buf);
|
||||||
_monitor_file_created_handler = ecore_event_handler_add
|
|
||||||
(EIO_MONITOR_FILE_CREATED, _elm_config_file_monitor_cb, NULL);
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile);
|
||||||
_monitor_directory_created_handler = ecore_event_handler_add
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
(EIO_MONITOR_DIRECTORY_CREATED, _elm_config_file_monitor_cb, NULL);
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile);
|
||||||
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
|
_eio_config_monitor = eio_monitor_add(buf);
|
||||||
|
|
||||||
|
_monitor_file_modified_handler = ecore_event_handler_add
|
||||||
|
(EIO_MONITOR_FILE_MODIFIED, _elm_config_file_monitor_cb, NULL);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
_config_sub_apply();
|
_config_sub_apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_elm_config_reload(void)
|
_elm_config_reload(Eina_Bool on_flush)
|
||||||
{
|
{
|
||||||
Eina_Bool is_mirrored;
|
Eina_Bool is_mirrored;
|
||||||
Eina_Bool translate;
|
Eina_Bool translate;
|
||||||
|
@ -4442,7 +4503,7 @@ _elm_config_reload(void)
|
||||||
is_mirrored = _elm_config->is_mirrored;
|
is_mirrored = _elm_config->is_mirrored;
|
||||||
translate = _elm_config->translate;
|
translate = _elm_config->translate;
|
||||||
|
|
||||||
_elm_config_reload_do();
|
_elm_config_reload_do(on_flush);
|
||||||
|
|
||||||
/* restore prev value which is not part of the EET file */
|
/* restore prev value which is not part of the EET file */
|
||||||
_elm_config->is_mirrored = is_mirrored;
|
_elm_config->is_mirrored = is_mirrored;
|
||||||
|
@ -4728,6 +4789,7 @@ _elm_config_profile_set(const char *profile)
|
||||||
Eina_Bool translate;
|
Eina_Bool translate;
|
||||||
is_mirrored = _elm_config->is_mirrored;
|
is_mirrored = _elm_config->is_mirrored;
|
||||||
translate = _elm_config->translate;
|
translate = _elm_config->translate;
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
if (!profile) return;
|
if (!profile) return;
|
||||||
|
|
||||||
|
@ -4741,9 +4803,15 @@ _elm_config_profile_set(const char *profile)
|
||||||
|
|
||||||
_elm_profile = strdup(profile);
|
_elm_profile = strdup(profile);
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", _elm_profile);
|
||||||
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
|
|
||||||
|
_elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/.base.flush.cfg", _elm_profile);
|
||||||
|
if(!ecore_file_exists(buf)) _file_touch(buf);
|
||||||
|
|
||||||
_color_overlays_cancel();
|
_color_overlays_cancel();
|
||||||
|
|
||||||
_elm_config_reload_do();
|
_elm_config_reload_do(EINA_FALSE);
|
||||||
|
|
||||||
/* restore prev value which is not part of the EET file */
|
/* restore prev value which is not part of the EET file */
|
||||||
_elm_config->is_mirrored = is_mirrored;
|
_elm_config->is_mirrored = is_mirrored;
|
||||||
|
@ -5307,6 +5375,25 @@ EOLIAN static void
|
||||||
_efl_config_global_profile_derived_del(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile)
|
_efl_config_global_profile_derived_del(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile)
|
||||||
{
|
{
|
||||||
elm_config_profile_derived_del(profile);
|
elm_config_profile_derived_del(profile);
|
||||||
|
|
||||||
|
}
|
||||||
|
static Eina_Bool
|
||||||
|
_file_touch(const char *file)
|
||||||
|
{
|
||||||
|
if (!file) return EINA_FALSE;
|
||||||
|
|
||||||
|
const char *dir = ecore_file_dir_get(file);
|
||||||
|
if(!dir) return EINA_FALSE;
|
||||||
|
if(!ecore_file_mkpath(dir)) return EINA_FALSE;
|
||||||
|
|
||||||
|
Eo *f = efl_add_ref(EFL_IO_FILE_CLASS, NULL,
|
||||||
|
efl_file_set(efl_added, file, NULL),
|
||||||
|
efl_io_file_flags_set(efl_added, O_CREAT|O_RDWR),
|
||||||
|
efl_io_file_mode_set(efl_added, 0644));
|
||||||
|
if (!f) return EINA_FALSE;
|
||||||
|
efl_unref(f);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "efl_config_global.eo.c"
|
#include "efl_config_global.eo.c"
|
||||||
|
|
|
@ -630,7 +630,7 @@ void _elm_config_sub_init(void);
|
||||||
void _elm_config_shutdown(void);
|
void _elm_config_shutdown(void);
|
||||||
void _elm_config_sub_shutdown(void);
|
void _elm_config_sub_shutdown(void);
|
||||||
Eina_Bool _elm_config_save(Elm_Config *cfg, const char *profile);
|
Eina_Bool _elm_config_save(Elm_Config *cfg, const char *profile);
|
||||||
void _elm_config_reload(void);
|
void _elm_config_reload(Eina_Bool on_flush);
|
||||||
size_t _elm_config_user_dir_snprintf(char *dst, size_t size,
|
size_t _elm_config_user_dir_snprintf(char *dst, size_t size,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
EINA_PRINTF(3, 4);
|
EINA_PRINTF(3, 4);
|
||||||
|
|
Loading…
Reference in New Issue