Merge "prevent issues are fixed.Id:47337,55238,56400,56431,50159,55300,55301,5623156263."
authorsumanth <sumanth.m@samsung.com>
Fri, 2 Dec 2011 08:44:40 +0000 (17:44 +0900)
committerGerrit Code Review <git@Maetan>
Fri, 2 Dec 2011 08:44:40 +0000 (17:44 +0900)
src/bin/test_fileselector.c
src/bin/test_map.c
src/bin/test_panel.c
src/lib/elm_calendar.c

index 5d3ac87..3f5b271 100644 (file)
@@ -119,6 +119,7 @@ test_fileselector(void *data       __UNUSED__,
                   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
@@ -147,8 +148,12 @@ test_fileselector(void *data       __UNUSED__,
    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);
index 8b1a033..3965469 100644 (file)
@@ -348,6 +348,7 @@ static void
 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");
@@ -366,7 +367,11 @@ map_track_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED
    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);
index dcc7c58..ef89efc 100644 (file)
@@ -90,7 +90,7 @@ _fill_list(Evas_Object *obj)
    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];
index 3ceb82f..89b52f7 100644 (file)
@@ -711,6 +711,7 @@ elm_calendar_add(Evas_Object *parent)
    Widget_Data *wd;
    int i, t;
    Evas *e;
+   struct tm weekday_time;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
 
@@ -758,7 +759,8 @@ elm_calendar_add(Evas_Object *parent)
          * 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);
           }