1. Sync with master
authorGangHeok Kim <gangheok.kim@samsung.com>
Mon, 8 Apr 2013 11:57:34 +0000 (20:57 +0900)
committerGangHeok Kim <gangheok.kim@samsung.com>
Mon, 15 Apr 2013 01:15:52 +0000 (10:15 +0900)
Change-Id: I07996c7790a7e23ddb0ede3b3c4776af29721201

mobileprint/app/pts_print_search.c
mobileprint/app/pts_setting_view.c
mobileprint/app/pts_util.c

index 21a8ff8..fc450ea 100644 (file)
@@ -687,20 +687,6 @@ Evas_Object *pts_create_content_printer_list(Evas_Object *parent, pts_appdata_t
                radio_index ++;
        }
 
-#if 0
-//     if (ld->ugd->print_search_mode != PTS_SEARCH_INITIAL) {
-
-               elm_genlist_item_append(
-                               genlist,
-                               &refresh_itc,
-                               (void *)ad,
-                               NULL,
-                               ELM_GENLIST_ITEM_NONE,
-                               NULL,
-                               NULL);
-//     }
-#endif
-
        *print_counter = radio_index-1;
        PTS_DEBUG("printer num = %d\n", *print_counter);
 
@@ -766,11 +752,12 @@ Evas_Object *pts_create_printer_list_popup(Evas_Object *parent, pts_appdata_t *a
        Evas_Object *box = elm_box_add(popup);
        evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
-/*
- * XXX - below 143 value is just for entry height of 2text.1icon.4 style in genlist
- */
        elm_box_pack_end(box, genlist);
 
+       /*
+        * XXX - below 143 value is just for entry height of 2text.1icon.4 style in genlist
+        */
+
        int rotate_angle = 0;
        if (ad->win) {
                rotate_angle = elm_win_rotation_get(ad->win);
@@ -791,18 +778,17 @@ Evas_Object *pts_create_printer_list_popup(Evas_Object *parent, pts_appdata_t *a
                PRINTER_LIST_POPUP_LN_W * elm_config_scale_get(),
                ad->list_info.printer_list_popup_landscape_height);
 
-       elm_object_content_set(popup, box);
-
        ad->list_info.printer_list_popup_box = box;
        ad->list_info.printer_list_popup = popup;
 
+       elm_object_content_set(popup, box);
        evas_object_show(genlist);
        evas_object_show(box);
        evas_object_show(popup);
        evas_object_show(parent);
 
        PTS_TRACE_END;
-       return genlist;
+       return popup;
 }
 
 void pts_search_printer_select(pts_appdata_t *ad)
@@ -869,7 +855,7 @@ static void __pts_get_printer_cb(pt_response_data_t *cb)
 Evas_Object *pts_create_print_search_popup(Evas_Object *parent)
 {
        PTS_TRACE_BEGIN;
-       PTS_RET_IF(parent == NULL, "parent is NULL");
+       PTS_RETV_IF(parent == NULL, NULL, "parent is NULL");
 
        int ret = 0;
        Evas_Object *layout = NULL;
index d46a748..08e4052 100644 (file)
@@ -990,39 +990,35 @@ static void __pts_setting_view_gl_realized(void *data, Evas_Object *obj, void *e
        void *item_data = elm_object_item_data_get(item);
        //PTS_RET_IF(NULL == item_data, "item data is NULL"); //FIXME: related to Jira issue #
 
-       if (item_data == (void *)ad->list_info.active_printer){
-           Evas_Object *ao = elm_object_item_access_object_get(item);
+       pt_print_option_e option = (pt_print_option_e)item_data;
+       PTS_RET_IF(option >= PT_OPTION_ID_MAX, "UNKNOWN OPTION REALIZED - %d", option);
+
+       PTS_DEBUG("realized print option: [%d]\n", option);
+
+       if (PT_OPTION_ID_PAPERSIZE == option
+                       || PT_OPTION_ID_RANGE == option
+                       || PT_OPTION_ID_QUALITY == option
+                       || PT_OPTION_ID_PAPER == option
+                       || PT_OPTION_ID_GRAYSCALE == option
+                       || PT_OPTION_ID_DUPLEX == option) {
+
+               Evas_Object *ao = elm_object_item_access_object_get(item);
+               PTS_RET_IF(NULL == ao, "Access object is NULL");
+               elm_access_info_set(ao, ELM_ACCESS_TYPE, IDS_SCRREAD_EXPANDABLE_LIST_TYPE);
+               elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, IDS_SCRREAD_EXPANDABLE_LIST_CONTEXT);
+               PTS_DEBUG("Item #%d access context info: [%s]", option, IDS_SCRREAD_EXPANDABLE_LIST_CONTEXT);
+       } else if (PT_OPTION_ID_COPIES == option) {
+               Evas_Object *ao = elm_object_item_access_object_get(item);
+               PTS_RET_IF(NULL == ao, "Access object is NULL");
+               elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, IDS_SCRREAD_SETTINS_ITEM_CONTEXT);
+               PTS_DEBUG("Item #%d access context info: [%s]", option, IDS_SCRREAD_SETTINS_ITEM_CONTEXT);
+       } else if (PT_OPTION_ID_PRINTER == option) {
+               Evas_Object *ao = elm_object_item_access_object_get(item);
                PTS_RET_IF(NULL == ao, "Access object is NULL");
                elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, IDS_SCRREAD_PRINTER_ITEM_CONTEXT);
                PTS_DEBUG("Item #printer access context info: [%s]", IDS_SCRREAD_PRINTER_ITEM_CONTEXT);
        }
-       else {
-               //REINTERPRETING POINTER since it's ENUM!
-               pt_print_option_e option = (pt_print_option_e)item_data;
-               PTS_RET_IF(option >= PT_OPTION_ID_MAX, "UNKNOWN OPTION REALIZED - %d", option);
-
-               PTS_DEBUG("realized print option: [%d]\n", option);
-
-               if (PT_OPTION_ID_PAPERSIZE == option
-                               || PT_OPTION_ID_RANGE == option
-                               || PT_OPTION_ID_QUALITY == option
-                               || PT_OPTION_ID_PAPER == option
-                               || PT_OPTION_ID_GRAYSCALE == option
-                               || PT_OPTION_ID_DUPLEX == option) {
-
-                       Evas_Object *ao = elm_object_item_access_object_get(item);
-                       PTS_RET_IF(NULL == ao, "Access object is NULL");
-                       elm_access_info_set(ao, ELM_ACCESS_TYPE, IDS_SCRREAD_EXPANDABLE_LIST_TYPE);
-                       elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, IDS_SCRREAD_EXPANDABLE_LIST_CONTEXT);
-                       PTS_DEBUG("Item #%d access context info: [%s]", option, IDS_SCRREAD_EXPANDABLE_LIST_CONTEXT);
-               }
-               else if (PT_OPTION_ID_COPIES == option) {
-                       Evas_Object *ao = elm_object_item_access_object_get(item);
-                       PTS_RET_IF(NULL == ao, "Access object is NULL");
-                       elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, IDS_SCRREAD_SETTINS_ITEM_CONTEXT);
-                       PTS_DEBUG("Item #%d access context info: [%s]", option, IDS_SCRREAD_SETTINS_ITEM_CONTEXT);
-               }
-       }
+
        PTS_TRACE_END;
 }
 
@@ -1082,7 +1078,7 @@ static Evas_Object *__pts_setting_view_create_content(Evas_Object *parent, pts_a
        ad->setting_info.printer_item = elm_genlist_item_append(
                                                        genlist,
                                                        &itc_printer,
-                                                       (void *)ad->list_info.active_printer,
+                                                       (void *)PT_OPTION_ID_PRINTER,
                                                        NULL,
                                                        ELM_GENLIST_ITEM_NONE,
                                                        __pts_setting_view_printer_sel, ad);
@@ -1184,6 +1180,7 @@ static Evas_Object *__pts_setting_view_create_content(Evas_Object *parent, pts_a
        return genlist;
 }
 
+#if 0
 Evas_Object *pt_util_add_bg(Evas_Object *obj, Eina_Bool is_window)
 {
        PTS_TRACE_BEGIN;
@@ -1205,6 +1202,7 @@ Evas_Object *pt_util_add_bg(Evas_Object *obj, Eina_Bool is_window)
        PTS_TRACE_END;
        return bg;
 }
+#endif
 
 /**
  *     This function let the app create setting view
index f1250fb..7e48020 100644 (file)
@@ -63,11 +63,17 @@ void pts_util_remove_tmp_files(const char *path)
        DIR *dir;
 
        cwd = get_current_dir_name();
+       PTS_RET_IF(cwd == NULL, "cwd is NULL");
 
        errno = 0;
        ret = chdir(path);
        if (ret == 0) {
                dir = opendir(path);
+               if (dir == NULL) {
+                       PTS_IF_FREE_MEM(cwd);
+                       PTS_TRACE_END;
+                       return;
+               }
                while ((entry = readdir(dir)) != NULL) {
                        PTS_DEBUG("Remove %s", entry->d_name);
                        iret = remove(entry->d_name);
@@ -78,8 +84,12 @@ void pts_util_remove_tmp_files(const char *path)
                closedir(dir);
 
                iret = chdir(cwd);
-               PTS_IF_FREE_MEM(cwd);
-               PTS_RET_IF(iret == -1, "unable to chdir");
+               if (iret == -1) {
+                       PTS_DEBUG("unable to chdir");
+                       PTS_IF_FREE_MEM(cwd);
+                       PTS_TRACE_END;
+                       return;
+               }
                rmdir(path);
        } else {
                if (errno == ENOENT) {