hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=5c23a5b66137149a2622c9f18d15ca0ee61a2837

commit 5c23a5b66137149a2622c9f18d15ca0ee61a2837
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Fri Jan 22 19:59:37 2016 +0900

    code refactoring.
    
    tools_close() returns a result in order that the caller decides a next 
behavior.
---
 src/bin/live_edit.c     | 6 ++++--
 src/bin/main.c          | 3 +--
 src/bin/tools.c         | 2 +-
 src/include/live_edit.h | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/bin/live_edit.c b/src/bin/live_edit.c
index c3214b5..a219d10 100644
--- a/src/bin/live_edit.c
+++ b/src/bin/live_edit.c
@@ -1006,11 +1006,11 @@ live_edit_get(void)
    return ld->on;
 }
 
-void
+Eina_Bool
 live_edit_cancel(void)
 {
    live_data *ld = g_ld;
-   if (!ld->on) return;
+   if (!ld->on) return EINA_FALSE;
 
    if (ld->ctxpopup) elm_ctxpopup_dismiss(ld->ctxpopup);
 
@@ -1057,6 +1057,8 @@ live_edit_cancel(void)
    ld->on = EINA_FALSE;
 
    tools_live_update(EINA_FALSE);
+
+   return EINA_TRUE;
 }
 
 void
diff --git a/src/bin/main.c b/src/bin/main.c
index 953c720..e342f39 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -699,9 +699,8 @@ keygrabber_key_down_cb(void *data, Evas *e EINA_UNUSED,
      {
         if (stats_ctxpopup_dismiss()) return;
 
-        if (live_edit_get())
+        if (live_edit_cancel())
           {
-             live_edit_cancel();
              enventor_object_focus_set(ad->enventor, EINA_TRUE);
              return;
           }
diff --git a/src/bin/tools.c b/src/bin/tools.c
index 968001a..1708df8 100644
--- a/src/bin/tools.c
+++ b/src/bin/tools.c
@@ -24,7 +24,7 @@ static void
 menu_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         void *event_info EINA_UNUSED)
 {
-   if (live_edit_get()) live_edit_cancel();
+   live_edit_cancel();
    if (search_is_opened()) search_close();
    if (goto_is_opened()) tools_goto_update();
 
diff --git a/src/include/live_edit.h b/src/include/live_edit.h
index 6696d2c..7cf6711 100644
--- a/src/include/live_edit.h
+++ b/src/include/live_edit.h
@@ -6,6 +6,6 @@
 void live_edit_init(Evas_Object *trigger);
 void live_edit_term(void);
 void live_edit_toggle(void);
-void live_edit_cancel(void);
+Eina_Bool live_edit_cancel(void);
 Eina_Bool live_edit_get(void);
 void live_edit_update(void);

-- 


Reply via email to