hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=64b88b4147a79a3c3b59290b1d5e2bb23cd2df1c

commit 64b88b4147a79a3c3b59290b1d5e2bb23cd2df1c
Author: Hermet Park <[email protected]>
Date:   Tue Aug 9 01:10:27 2016 +0900

    file_mgr: avoid unnecessary item focus.
---
 src/bin/file_mgr.c     | 13 ++++++++-----
 src/include/file_mgr.h |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/bin/file_mgr.c b/src/bin/file_mgr.c
index bcb88f5..597b75a 100644
--- a/src/bin/file_mgr.c
+++ b/src/bin/file_mgr.c
@@ -242,14 +242,17 @@ file_mgr_file_del(Enventor_Item *it)
 }
 
 Enventor_Item *
-file_mgr_sub_file_add(const char *path)
+file_mgr_sub_file_add(const char *path, Eina_Bool focus)
 {
    Enventor_Item *it = enventor_object_sub_item_add(base_enventor_get(), path);
    EINA_SAFETY_ON_NULL_RETURN_VAL(it, NULL);
 
    file_tab_it_add(it);
-   file_tab_it_select(it);
-   file_mgr_file_focus(it);
+   if (focus)
+     {
+        file_tab_it_select(it);
+        file_mgr_file_focus(it);
+     }
 
    return it;
 }
@@ -308,7 +311,7 @@ file_mgr_main_file_set(const char *path)
      {
         const char *file_path = NULL;
         file_path = enventor_item_file_get(main_it);
-        file_mgr_sub_file_add(file_path);
+        file_mgr_sub_file_add(file_path, EINA_FALSE);
         file_mgr_file_del(main_it);
      }
 
@@ -453,5 +456,5 @@ file_mgr_file_open(const char *file_path)
      }
 
    //This selected file hasn't been opened yet, so let's open this file newly.
-   file_mgr_sub_file_add(file_path);
+   file_mgr_sub_file_add(file_path, EINA_TRUE);
 }
diff --git a/src/include/file_mgr.h b/src/include/file_mgr.h
index 34be535..900a5c5 100644
--- a/src/include/file_mgr.h
+++ b/src/include/file_mgr.h
@@ -7,7 +7,7 @@ int file_mgr_edc_modified_get(void);
 void file_mgr_reset(void);
 void file_mgr_edc_save(void);
 Enventor_Item *file_mgr_main_file_set(const char *path);
-Enventor_Item *file_mgr_sub_file_add(const char *path);
+Enventor_Item *file_mgr_sub_file_add(const char *path, Eina_Bool focus);
 Enventor_Item *file_mgr_focused_item_get(void);
 void file_mgr_file_focus(Enventor_Item *it);
 Eina_Bool file_mgr_save_all(void);

-- 


Reply via email to