Fileselector: Use eina_environment_home_get() instead of getenv("HOME")
This commit is contained in:
parent
413f4b43ab
commit
6cb5842268
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue