tasn pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=bd1d4427b8294ea2b435d5171603c836cc627e41

commit bd1d4427b8294ea2b435d5171603c836cc627e41
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Wed Jul 22 13:01:12 2015 +0200

    Fileselector: Use eina_environment_home_get() instead of getenv("HOME")
---
 src/lib/elc_fileselector.c        | 14 +-------------
 src/lib/elc_fileselector_button.c |  5 ++++-
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index eb66368..d541c5f 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -17,10 +17,6 @@
 #include "elm_interface_fileselector.h"
 #include "elm_widget_fileselector.h"
 
-#ifdef HAVE_EVIL
-# include <Evil.h>
-#endif
-
 #define MY_CLASS ELM_FILESELECTOR_CLASS
 
 #define MY_CLASS_NAME "Elm_Fileselector"
@@ -1012,16 +1008,8 @@ _home(void *data,
       void *event_info EINA_UNUSED)
 {
    Evas_Object *fs = data;
-   const char * path = NULL;
-
-#ifdef HAVE_EVIL
-   path = (char*)evil_homedir_get();
-#else
-   path = getenv("HOME");
-#endif
-
 
-   _populate(fs, path, NULL, NULL);
+   _populate(fs, eina_environment_home_get(), NULL, NULL);
 
    return EINA_TRUE;
 }
diff --git a/src/lib/elc_fileselector_button.c 
b/src/lib/elc_fileselector_button.c
index 9d6cbe8..e602a91 100644
--- a/src/lib/elc_fileselector_button.c
+++ b/src/lib/elc_fileselector_button.c
@@ -174,11 +174,14 @@ _button_clicked(void *data,
 EOLIAN static void
 _elm_fileselector_button_evas_object_smart_add(Eo *obj, 
Elm_Fileselector_Button_Data *priv)
 {
+   const char *path;
+
    eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
    elm_widget_sub_object_parent_add(obj);
 
    priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE);
-   if (getenv("HOME")) priv->fsd.path = eina_stringshare_add(getenv("HOME"));
+   path = eina_environment_home_get();
+   if (path) priv->fsd.path = eina_stringshare_add(path);
    else priv->fsd.path = eina_stringshare_add("/");
 
    priv->fsd.expandable = _elm_config->fileselector_expand_enable;

-- 


Reply via email to