Fix issue
[apps/home/taskmanager.git] / src / _genlist.c
index 88a8341..74bab7a 100755 (executable)
@@ -160,8 +160,6 @@ _D("func\n");
        struct appdata *ad = data;
        char buf[_BUF_MAX] = { 0, };
 
-//     refresh_app_info(ad);
-
        ad->mode = MODE_DEL_ALL_HISTORY;
        snprintf(buf, sizeof(buf), T_("IDS_TASKMGR_POP_CLEAR_ALL_APP_HISTORY_Q"));
        if (ad->popup_ask) {
@@ -187,7 +185,6 @@ static void end_inuse_cb(void *data, Evas_Object *obj, void *event_info)
        }
        ad->popup_ask = _add_popup_ask(ad->win, buf, ad);
        g_egi = (void *)info_ev->it;
-//     evas_object_data_set(ad->popup_ask, "selected_egi", (void *)info_ev->it);
 }
 
 static void delete_history_cb(void *data, Evas_Object *obj, void *event_info)
@@ -207,7 +204,6 @@ static void delete_history_cb(void *data, Evas_Object *obj, void *event_info)
        }
        ad->popup_ask = _add_popup_ask(ad->win, buf, ad);
        g_egi = (void *)info_ev->it;
-//     evas_object_data_set(ad->popup_ask, "selected_egi", (void *)info_ev->it);
 }
 
 static void nl_sel(void *data, Evas_Object *obj, void *event_info)
@@ -331,11 +327,9 @@ static Evas_Object *_gl_content_get_app(void *data, Evas_Object *obj,
                retvm_if(rt == NULL, NULL, "Failed to add rectangle\n");
 
                evas_object_color_set(rt, 0, 0, 0, 0);
-               evas_object_size_hint_min_set(rt, 50, 50);
-//             evas_object_size_hint_min_set(rt, (int)(50.0 * scale),
-//                                           (int)(50.0 * scale));
-//             evas_object_size_hint_max_set(rt, (int)(50.0 * scale),
-//                                           (int)(50.0 * scale));
+               evas_object_size_hint_min_set(rt, 
+                                       (int)72 * elm_scale_get(), 
+                                       (int)72 * elm_scale_get());
                elm_object_part_content_set(icon, "icon_ly", rt);
 
                elm_object_part_content_set(icon, "icon", icon_ly);
@@ -350,12 +344,6 @@ static Evas_Object *_gl_content_get_app(void *data, Evas_Object *obj,
                evas_object_smart_callback_add(btn, "clicked",
                                               func_end[info->category], info);
                elm_object_focus_set(btn, EINA_FALSE);
-
-//             evas_object_size_hint_min_set(btn, (int)(90.0 * scale),
-//                                           (int)(47.0 * scale));
-//             evas_object_size_hint_max_set(btn, (int)(90.0 * scale),
-//                                           (int)(47.0 * scale));
-
                evas_object_propagate_events_set(btn, EINA_FALSE);
 
                return btn;
@@ -429,9 +417,6 @@ static Evas_Object *_bl_content_get(void *data, Evas_Object *obj,
 
                evas_object_size_hint_min_set(btn, 0, 50);
                evas_object_size_hint_max_set(btn, 0, 50);
-//             evas_object_size_hint_min_set(btn, 0, (int)(47.0 * scale));
-//             evas_object_size_hint_max_set(btn, 0, (int)(47.0 * scale));
-
                evas_object_propagate_events_set(btn, EINA_FALSE);
 
                return btn;
@@ -499,11 +484,9 @@ static Evas_Object *_gl_content_get_his(void *data, Evas_Object *obj,
                retvm_if (rt == NULL, NULL, "Failed to add rectangle\n");
 
                evas_object_color_set(rt, 0, 0, 0, 0);
-               evas_object_size_hint_min_set(rt, 50, 50);
-//             evas_object_size_hint_min_set(rt, (int)(50.0 * scale),
-//                                           (int)(50.0 * scale));
-//             evas_object_size_hint_max_set(rt, (int)(50.0 * scale),
-//                                           (int)(50.0 * scale));
+               evas_object_size_hint_min_set(rt, 
+                                       (int)72 * elm_scale_get(), 
+                                       (int)72 * elm_scale_get());
                elm_object_part_content_set(icon, "icon_ly", rt);
 
                elm_object_part_content_set(icon, "icon", icon_ly);
@@ -518,12 +501,6 @@ static Evas_Object *_gl_content_get_his(void *data, Evas_Object *obj,
                evas_object_smart_callback_add(btn, "clicked",
                                               func_end[info->category], info);
                elm_object_focus_set(btn, EINA_FALSE);
-
-       //      evas_object_size_hint_min_set(btn, (int)(90.0 * scale),
-       //                                    (int)(47.0 * scale));
-       //      evas_object_size_hint_max_set(btn, (int)(90.0 * scale),
-       //                                    (int)(47.0 * scale));
-
                evas_object_propagate_events_set(btn, EINA_FALSE);
 
                return btn;
@@ -538,11 +515,11 @@ void _set_itc(void)
        itc_gl.item_style = "grouptitle";
        itc_gl.func.text_get = _gl_text_get_title;
 
-       itc_dl.item_style = "2text.2icon.4";
+       itc_dl.item_style = "2text.2icon.7";
        itc_dl.func.text_get = _gl_text_get_app;
        itc_dl.func.content_get = _gl_content_get_app;
 
-       itc_hl.item_style = "1text.2icon.4";
+       itc_hl.item_style = "1text.2icon.1";
        itc_hl.func.text_get = _gl_text_get_his;
        itc_hl.func.content_get = _gl_content_get_his;
 
@@ -550,7 +527,6 @@ void _set_itc(void)
        itc_separator2.item_style = "dialogue/seperator.2";
 
        itc_bl.item_style = "dialogue/bg/1icon";
-//     itc_bl.item_style = "1icon";
        itc_bl.func.content_get = _bl_content_get;
 
        itc_nl.item_style = "1text";
@@ -707,12 +683,23 @@ void _set_genlist(struct appdata *ad)
 _D("func\n");
        retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
        int ret = AUL_R_ERROR;
+       int retry_cnt = 0;
+       int sleep_value = 1000;
 
        _init_grp_cnt();
 
-       while (ret != AUL_R_OK)
+       while (ret != AUL_R_OK && retry_cnt < 5) {
+               usleep(sleep_value);
                ret = aul_app_get_running_app_info(runapp_info_get, ad);
 
+               if (ret != AUL_R_OK) {
+                       _D("Fail to get running app information from ail");
+               }
+
+               retry_cnt++;
+               sleep_value *= 2;
+       }
+
        taskmanager_get_history_app_info(ad);
        _set_genlist_from_eina(ad);
 
@@ -799,16 +786,15 @@ _D("func\n");
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
 
        ad->ending = EINA_TRUE;
-//     egi = evas_object_data_get(ad->popup_ask, "selected_egi");
 
        EINA_LIST_FOREACH_SAFE(ad->applist[TS_INUSE], l, l_next, info) {
+               _D("applist pid : %d", info->pid);
                if (info->it == g_egi) {
+                       _D("matched applist pid : %d", info->pid);
                        if (info->pid > 0) {
                                if (aul_terminate_pid(info->pid) < 0) {
                                        kill(info->pid, SIGKILL);
                                }
-//                             ad->applist[TS_INUSE] =
-//                                     eina_list_remove_list(ad->applist[TS_INUSE], l);
                        }
                        break;
                }
@@ -849,13 +835,12 @@ int response_end_all_inuse(struct appdata *ad)
 
        EINA_LIST_FOREACH(ad->applist[TS_INUSE], l, info) {
                if (info != NULL) {
+                       _D("applist pid : %d", info->pid);
                        if (info->pid > 0) {
                                if (aul_terminate_pid(info->pid) < 0) {
                                        kill(info->pid, SIGKILL);
                                }
                                _D("terminated\n");
-//                             ad->applist[TS_INUSE] =
-//                                     eina_list_remove_list(ad->applist[TS_INUSE], l);
                        }
                }
        }
@@ -872,8 +857,8 @@ int response_del_history(struct appdata *ad)
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
 
        _show_progressbar(ad);
-//     egi = evas_object_data_get(ad->popup_ask, "selected_egi");
        EINA_LIST_FOREACH_SAFE(ad->applist[TS_HISTORY], l, l_next, info) {
+               _D("history applist pid : %d", info->pid);
                if (info->it == g_egi) {
 
                        if (rua_init() == -1) {
@@ -951,9 +936,9 @@ int response_kill_inuse(struct appdata *ad)
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
 
        _show_progressbar(ad);
-//     egi = evas_object_data_get(ad->popup_ask, "selected_egi");
 
        EINA_LIST_FOREACH_SAFE(ad->applist[TS_INUSE], l, l_next, info) {
+               _D("kill applist pid : %d", info->pid);
                if (info->it == g_egi) {
                        if (info->pid > 0) {
                                kill(info->pid, SIGKILL);
@@ -981,6 +966,7 @@ int response_kill_all_inuse(struct appdata *ad)
        _show_progressbar(ad);
 
        EINA_LIST_FOREACH(ad->applist[TS_INUSE], l, info) {
+               _D("kill all applist pid : %d", info->pid);
                if (info != NULL) {
                        if (info->pid > 0) {
                                kill(info->pid, SIGKILL);