elm: rename _use_build_config variable -> _running_in_tree
authorMike Blumenkrantz <zmike@samsung.com>
Tue, 24 Sep 2019 20:59:49 +0000 (16:59 -0400)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 24 Sep 2019 21:51:51 +0000 (06:51 +0900)
Summary:
this makes the meaning of the variable more clear

no functional changes
Depends on D10092

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10093

src/lib/elementary/elm_config.c
src/lib/elementary/elm_main.c
src/lib/elementary/elm_priv.h

index c94c8c8..ac7b86b 100644 (file)
@@ -1092,7 +1092,7 @@ _elm_config_profile_dir_get(const char *prof,
    if (!is_user)
      goto not_user;
 
-   if ((!_use_build_config) || (!bs_data_path_get(buf, sizeof(buf), "elementary/config", prof)))
+   if ((!_running_in_tree) || (!bs_data_path_get(buf, sizeof(buf), "elementary/config", prof)))
      _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s", prof);
 
    // See elm_config_profile_dir_free: always use strdup+free
@@ -1102,7 +1102,7 @@ _elm_config_profile_dir_get(const char *prof,
    return NULL;
 
 not_user:
-   if ((!_use_build_config) || (!bs_data_path_get(buf, sizeof(buf), "elementary/config", prof)))
+   if ((!_running_in_tree) || (!bs_data_path_get(buf, sizeof(buf), "elementary/config", prof)))
      snprintf(buf, sizeof(buf), "%s/config/%s", _elm_data_dir, prof);
 
    // See elm_config_profile_dir_free: always use strdup+free
@@ -1491,7 +1491,7 @@ _elm_config_profiles_list(Eina_Bool hide_profiles)
    const char *dir;
    size_t len = 0;
 
-   if (_use_build_config)
+   if (_running_in_tree)
      {
         len = bs_data_path_get(buf, sizeof(buf), "elementary", "config");
         if (len) len = strlen(buf);
@@ -1579,7 +1579,7 @@ _profile_fetch_from_conf(void)
    Eet_File *ef = NULL;
    int len = 0, i;
 
-   if (_use_build_config) goto end;
+   if (_running_in_tree) goto end;
    // if env var - use profile without question
    s = _getenv_once("ELM_PROFILE");
    if (s)
@@ -1871,7 +1871,7 @@ _config_load(void)
    efl_provider_register(efl_main_loop_get(), EFL_CONFIG_INTERFACE, _efl_config_obj);
    efl_provider_register(efl_main_loop_get(), EFL_CONFIG_GLOBAL_CLASS, _efl_config_obj);
    efl_del_intercept_set(_efl_config_obj, _efl_config_obj_del);
-   if (!_use_build_config)
+   if (!_running_in_tree)
      {
         _elm_config = _config_user_load();
         if (_elm_config)
@@ -2377,7 +2377,7 @@ _elm_config_profile_save(const char *profile)
    Eet_File *ef;
    size_t len;
 
-   if (_use_build_config || ((s = _getenv_once("ELM_PROFILE_NOSAVE")) && atoi(s)))
+   if (_running_in_tree || ((s = _getenv_once("ELM_PROFILE_NOSAVE")) && atoi(s)))
      return EINA_TRUE;
 
    len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
@@ -3393,7 +3393,7 @@ elm_config_profile_exists(const char *profile)
 
    if (!profile) return EINA_FALSE;
 
-   if (_use_build_config)
+   if (_running_in_tree)
      {
         if (!bs_data_path_get(buf, sizeof(buf), "elementary/config", profile)) return EINA_FALSE;
         return ecore_file_exists(buf);
@@ -4543,7 +4543,7 @@ elm_config_all_flush(void)
    int ok = 0;
    size_t len;
 
-   if (_use_build_config) return;
+   if (_running_in_tree) return;
    len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/");
    if (len + 1 >= sizeof(buf))
      return;
@@ -4650,7 +4650,7 @@ _elm_config_sub_shutdown(void)
    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);
-   _use_build_config = EINA_FALSE;
+   _running_in_tree = EINA_FALSE;
 }
 
 static Eina_Bool
@@ -4742,7 +4742,7 @@ _elm_config_sub_init(void)
    char buf[PATH_MAX];
    int ok = 0;
 
-   if (_use_build_config)
+   if (_running_in_tree)
      ok = bs_data_path_get(buf, sizeof(buf), "elementary", "config");
    else
      {
index f445f25..1cad7f6 100644 (file)
@@ -43,7 +43,7 @@
 # define LIBEXT ".so"
 #endif
 
-Eina_Bool _use_build_config;
+Eina_Bool _running_in_tree;
 
 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
 // TIZEN_ONLY(20171114) Accessibility Highlight Frame added
@@ -818,7 +818,7 @@ elm_quicklaunch_init(int    argc EINA_UNUSED,
 
    traceTaskStart("elm_quicklaunch_init");
 
-   _use_build_config = !!getenv("EFL_RUN_IN_TREE");
+   _running_in_tree = !!getenv("EFL_RUN_IN_TREE");
    EINA_SAFETY_ON_FALSE_GOTO(eina_init(), fail_eina);
    _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
    EINA_SAFETY_ON_TRUE_GOTO(_elm_log_dom < 0, fail_eina_log);
@@ -861,7 +861,7 @@ elm_quicklaunch_init(int    argc EINA_UNUSED,
                          LOCALE_DIR);
    if (pfx)
      {
-        if (_use_build_config)
+        if (_running_in_tree)
           _elm_data_dir = eina_stringshare_add(PACKAGE_BUILD_DIR "/data/elementary");
         else
           _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
index ce1e75d..47f0839 100644 (file)
@@ -962,7 +962,7 @@ _elm_atspi_enabled()
 }
 //
 
-extern Eina_Bool _use_build_config;
+extern Eina_Bool _running_in_tree;
 
 /* Used by the paste handler */
 void   _elm_entry_entry_paste(Evas_Object *obj, const char *entry);