void *event_info __UNUSED__)
{
Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt, *sep;
+ char *path = NULL;
/* Set the locale according to the system pref.
* If you dont do so the file selector will order the files list in
elm_fileselector_is_save_set(fs, EINA_TRUE);
/* make the file list a tree with dir expandable in place */
elm_fileselector_expandable_set(fs, EINA_FALSE);
- /* start the fileselector in the home dir */
- elm_fileselector_path_set(fs, getenv("HOME"));
+ /* start the fileselector in the home dir
+ if home is not available, start from current dir */
+ path = getenv("HOME");
+ if (!path)
+ path = ".";
+ elm_fileselector_path_set(fs, path);
/* allow fs to expand in x & y */
evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
map_track_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *fs, *bg, *vbox, *hbox, *sep;
+ char *path = NULL;
fs_win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
elm_win_title_set(fs_win, "File Selector");
fs = elm_fileselector_add(fs_win);
elm_fileselector_is_save_set(fs, EINA_TRUE);
elm_fileselector_expandable_set(fs, EINA_FALSE);
- elm_fileselector_path_set(fs, getenv("HOME"));
+ path = getenv("HOME");
+ //if "HOME" is not available, set current dir. path
+ if (!path)
+ path = ".";
+ elm_fileselector_path_set(fs, path);
evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(vbox, fs);
Eina_List *dirs = NULL, *l;
char *real;
- if (!(d = opendir(getenv("HOME")))) return;
+ if ((!(getenv("HOME")))||(!(d = opendir(getenv("HOME"))))) return;
while ((de = readdir(d)))
{
char buff[PATH_MAX];
Widget_Data *wd;
int i, t;
Evas *e;
+ struct tm weekday_time;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
* just make it larger. :| */
char buf[20];
/* I don't know of a better way of doing it */
- if (strftime(buf, sizeof(buf), "%a", gmtime(&weekday)))
+ gmtime_r(&weekday, &weekday_time);
+ if (strftime(buf, sizeof(buf), "%a", &weekday_time))
{
wd->weekdays[i] = eina_stringshare_add(buf);
}