diff options
author | Wonki Kim <wonki_.kim@samsung.com> | 2019-03-27 10:18:33 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-03-27 10:58:30 -0400 |
commit | 8e8aa74751fa9d2ff450acd789d0fdd22ab72171 (patch) | |
tree | 82519ea8c4fc81b418a80b8b46b97df88f5f7525 | |
parent | 9367dcc755ec82acf75b3b2cf7b7c99383c60e8e (diff) | |
download | efl-8e8aa74751fa9d2ff450acd789d0fdd22ab72171.tar.gz |
entry: move a point to do 'auto_save' to another place
Summary:
By reworking on efl_file, logic flow for entry has been changed.
and it causes autosave making a file that is passed to elm_entry_file_set empty.
Test Plan:
1. call elm_entry_file_set for a file.
2. check the file is not empty after calling the function.
Reviewers: zmike, bu5hm4n
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8362
-rw-r--r-- | src/lib/elementary/elm_entry.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index ed7035fd90..7acdf40a1c 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -284,7 +284,7 @@ _save_do(Evas_Object *obj) { ELM_ENTRY_DATA_GET(obj, sd); - if (!sd->file) return; + if (!efl_file_loaded_get(obj)) return; switch (sd->format) { case ELM_TEXT_FORMAT_PLAIN_UTF8: @@ -4983,6 +4983,9 @@ EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) { Eina_Bool ret; + ELM_ENTRY_DATA_GET(obj, sd); + ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); + if (sd->auto_save) _save_do(obj); elm_obj_entry_file_text_format_set(obj, format); ret = efl_file_simple_load(obj, file, NULL); return ret; @@ -4996,15 +4999,13 @@ _elm_entry_efl_file_unload(Eo *obj, Elm_Entry_Data *sd EINA_UNUSED) } EOLIAN static Eina_Error -_elm_entry_efl_file_load(Eo *obj, Elm_Entry_Data *sd) +_elm_entry_efl_file_load(Eo *obj, Elm_Entry_Data *sd EINA_UNUSED) { Eina_Error err; if (efl_file_loaded_get(obj)) return 0; err = efl_file_load(efl_super(obj, MY_CLASS)); if (err) return err; - ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); - if (sd->auto_save) _save_do(obj); return _load_do(obj); } |