4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Tarun Kumar <tarun.kr@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 #define UG_MODULE_API __attribute__ ((visibility("default")))
26 #include "myaccount_ug_common.h"
27 #include "myaccount_ug_addaccount.h"
28 #include "myaccount_ug_account_list.h"
30 #include <app_manager.h>
31 #include <system_settings.h>
32 #include <iniparser.h>
34 #define SORT_PRIOR_1 "1_"
35 #define SORT_PRIOR_2 "2_"
36 #define SORT_PRIOR_3 "3_"
38 static Elm_Genlist_Item_Class addacc_list_itc;
40 static bool _myaccount_addaccount_get_account_type_info_cb(account_type_h account_type, void *user_data);
42 static char *__myaccount_addaccount_gl_label_get(void *data,
43 Evas_Object *obj, const char *part)
45 addaccount_list_priv *service = (addaccount_list_priv*)data;
48 if (!strcmp(part, "elm.text")) {
51 char *tmp_sp_name = NULL;
53 rc = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &value);
54 if ( rc != SYSTEM_SETTINGS_ERROR_NONE ) {
55 MYACCOUNT_DBUG("system_settings_get_value_int fail, rc=%d, value=%d", rc, value);
58 tmp_sp_name = elm_entry_utf8_to_markup(service->service_name);
60 if(!strcmp(service->service_name, dgettext(MA_UG_NAME, "IDS_EMAIL_BODY_MICROSOFT_EXCHANGE_ACTIVESYNC"))
61 && value == SYSTEM_SETTINGS_FONT_SIZE_NORMAL) {
64 MA_SNPRINTF(buf, sizeof(buf), "<font_size=%d>%s</font_size>", 37, tmp_sp_name);
65 MA_MEMFREE(tmp_sp_name);
76 bool myaccount_add_account_by_package_name_cb(account_h account,
82 static void __myaccount_addaccount_gl_sel(void *data,
83 Evas_Object *obj, void *event_info)
85 myaccount_appdata *ad = myaccount_get_appdata();
86 addaccount_list_priv *service = (addaccount_list_priv*)data;
87 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
88 char email_sp[64] = {0,};
91 MYACCOUNT_ERROR("__myaccount_account_list_gl_sel appdata is NULL\n");
95 MYACCOUNT_DBUG("ad->item_selected_state=%d\n", myaccount_common_get_item_selected_state());
97 if( myaccount_common_get_item_selected_state() ) {
98 elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
102 myaccount_common_set_item_selected_state(true);
105 elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
107 switch(service->sp_type) {
108 case MYACCOUNT_TYPE_PICASA :
109 case MYACCOUNT_TYPE_YOUTUBE :
110 case MYACCOUNT_TYPE_EXCHANGE :
111 myaccount_common_launch_application(
112 MYACCOUNT_REQUEST_SIGNIN,
113 strdup(service->package_name),
120 case MYACCOUNT_TYPE_GOOGLE :
121 MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", "gmail");
122 myaccount_common_launch_application(
123 MYACCOUNT_REQUEST_SIGNIN,
124 strdup(service->package_name),
131 case MYACCOUNT_TYPE_OTHER:
132 MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", "others");
133 myaccount_common_launch_application(
134 MYACCOUNT_REQUEST_SIGNIN,
135 strdup(service->package_name),
142 case MYACCOUNT_TYPE_CSC:
143 MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", service->service_name);
144 myaccount_common_launch_application(
145 MYACCOUNT_REQUEST_SIGNIN,
146 strdup(service->package_name),
154 if(myaccount_common_launch_application(
155 MYACCOUNT_REQUEST_SIGNIN,
156 strdup(service->package_name),
161 ad) != APP_CONTROL_ERROR_NONE ) {
162 MYACCOUNT_ERROR("__myaccount_addaccount_gl_sel : Failed to launch application\n");
163 myaccount_common_set_item_selected_state(false);
173 static Evas_Object *__myaccount_addaccount_icon_get( void *data,
174 Evas_Object *obj, const char *part)
176 char tempbuf[PATH_MAX];
177 Evas_Object *icon = NULL;
178 addaccount_list_priv *service_item = (addaccount_list_priv*)data;
179 Evas_Object *ic = NULL;
182 MYACCOUNT_ERROR(" __myaccount_addaccount_icon_get: Data is NULL\n");
185 memset(tempbuf, 0, sizeof(char)*PATH_MAX);
187 if (!strcmp(part, "elm.swallow.icon")) {
188 if (strlen(service_item->icon_path) > 0) {
189 MA_STRNCPY(tempbuf, service_item->icon_path, sizeof(tempbuf));
191 MA_STRNCPY(tempbuf, "A01_2_Icon_default.png", sizeof(tempbuf));
193 ic = elm_layout_add(obj);
194 elm_layout_theme_set(ic, "layout", "list/B/type.2", "default");
196 icon = elm_image_add(obj);
197 if (strstr(tempbuf, "/"))
198 elm_image_file_set(icon, tempbuf, NULL);
200 elm_image_file_set(icon, MA_IMAGE_EDJ_NAME, tempbuf);
202 elm_layout_content_set(ic, "elm.swallow.content", icon);
207 void myaccount_addaccount_free_priv_data(myaccount_appdata *appdata)
210 myaccount_appdata *ad = (myaccount_appdata *)appdata;
213 MYACCOUNT_ERROR("No appdata!!\n");
217 for(it=ad->sorted_sp_list;it!=NULL;it=g_list_next(it)) {
218 addaccount_list_priv* tmp = (addaccount_list_priv*)it->data;
222 ad->sorted_sp_list = NULL;
225 static addaccount_list_priv*
226 _myaccount_addaccount_create_priv_item()
228 addaccount_list_priv* sp_info = NULL;
229 sp_info = (addaccount_list_priv*)calloc(1,sizeof(addaccount_list_priv));
231 MYACCOUNT_ERROR("memory allocation fail\n");
234 memset(sp_info, 0x00, sizeof(addaccount_list_priv));
238 static bool _myaccount_addaccount_get_account_type_info_cb(account_type_h account_type, void *user_data)
240 GList **service_info_list = (GList **)user_data;
241 char* type_buf = NULL;
242 int type_int = -1, ret = -1;
243 addaccount_list_priv* sp_info = NULL;
245 if(account_type == NULL) {
246 MYACCOUNT_ERROR(" account type handle is NULL \n");
250 sp_info = _myaccount_addaccount_create_priv_item();
252 if(sp_info == NULL) {
253 MYACCOUNT_ERROR(" sp_info is NULL \n");
257 ret = account_type_get_app_id(account_type, &type_buf);
258 if(ret == ACCOUNT_ERROR_NONE ) {
260 MA_STRNCPY(sp_info->package_name, type_buf,
261 sizeof(sp_info->package_name));
263 MYACCOUNT_ERROR("No appid available\n");
266 MYACCOUNT_ERROR("account_type_get_app_id return(%x)\n", ret);
268 MA_MEMFREE(type_buf);
270 myaccount_appdata* ad = NULL;
271 ad = myaccount_get_appdata();
274 if(ad->called_from && !strcmp(ad->called_from, "setup_wizard")){
275 MYACCOUNT_ERROR("FROM SETUP WIZARD\n");
276 if(!strcmp(sp_info->package_name, SAMSUNG_ACCOUNT_APPID)) {
279 } else if(!strcmp(sp_info->package_name, TIZEN_ACCOUNT_APPID)) {
285 MYACCOUNT_ERROR("app data is null\n");
288 if(!strcmp(sp_info->package_name, "email-setting-efl")) {
291 sp_info = _myaccount_addaccount_create_priv_item();
292 if ( sp_info == NULL ) {
293 MYACCOUNT_ERROR("sp_info is NULL\n");
297 MA_STRNCPY(sp_info->service_name,
298 dgettext(MA_UG_NAME, "IDS_COM_BODY_EMAIL"),
299 sizeof(sp_info->service_name));
300 MA_SNPRINTF(sp_info->service_sname, sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_3, sp_info->service_name);
301 MA_STRNCPY(sp_info->package_name,
303 sizeof(sp_info->package_name));
304 //myaccount_common_get_icon_by_name("email",
305 // sp_info->icon_path);
307 ret = account_type_get_icon_path(account_type, &type_buf);
308 if(ret == ACCOUNT_ERROR_NONE ) {
310 MA_STRNCPY(sp_info->icon_path, type_buf,
311 sizeof(sp_info->icon_path));
313 MYACCOUNT_ERROR("No icon path available\n");
316 MYACCOUNT_ERROR("account_type_get_app_id return(%x)\n", ret);
318 MA_MEMFREE(type_buf);
320 sp_info->sp_type = MYACCOUNT_TYPE_OTHER;
321 sp_info->b_tizen_email = TRUE;
322 *service_info_list = g_list_append(*service_info_list, (void*)sp_info);
325 } else if(!strcmp(sp_info->package_name, "activesync-ui")) {
326 sp_info->b_tizen_email = TRUE;
327 } else if(!strcmp(sp_info->package_name, "com.samsung.rcs-im")
328 || !strcmp(sp_info->package_name, "ims-service")) {
331 } else if(!strcmp(sp_info->package_name, GOOGLE_ACCOUNT_APPID)) {
332 sp_info->b_tizen_email = TRUE;
335 ret = account_type_get_icon_path(account_type, &type_buf);
336 if(ret == ACCOUNT_ERROR_NONE ) {
338 MA_STRNCPY(sp_info->icon_path, type_buf,
339 sizeof(sp_info->icon_path));
341 MYACCOUNT_ERROR("No icon path available\n");
344 MYACCOUNT_ERROR("account_type_get_app_id return(%x)\n", ret);
346 MA_MEMFREE(type_buf);
348 char* provider_name = NULL;
350 if(ad && ad->current_language){
352 if(!strcmp(ad->current_language, "en_US")){
353 ret = account_type_get_label_by_locale(account_type, "en_GB", &provider_name);
355 ret = account_type_get_label_by_locale(account_type, ad->current_language, &provider_name);
359 if(ret != ACCOUNT_ERROR_NONE){
360 /* fallback scenario */
361 ret = account_type_get_label_by_locale(account_type, "default", &provider_name);
362 if(ret != ACCOUNT_ERROR_NONE){
363 MYACCOUNT_SLOGE("No service name(%s)\n", sp_info->package_name);
369 MA_STRNCPY(sp_info->service_name, provider_name,
370 sizeof(sp_info->service_name));
372 MA_MEMFREE(provider_name);
374 if(!strcmp(sp_info->package_name, SAMSUNG_ACCOUNT_APPID)) {
375 MA_SNPRINTF(sp_info->service_sname,
376 sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_1, sp_info->service_name);
377 } else if(!strcmp(sp_info->package_name, TIZEN_ACCOUNT_APPID)){
378 MA_SNPRINTF(sp_info->service_sname,
379 sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_1, sp_info->service_name);
381 MA_SNPRINTF(sp_info->service_sname,
382 sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_3, sp_info->service_name);
385 account_type_get_multiple_account_support(account_type, &type_int);
386 sp_info->multiple_account_support = type_int;
389 && account_query_account_by_package_name(myaccount_add_account_by_package_name_cb, sp_info->package_name, NULL) == ACCOUNT_ERROR_NONE) {
394 *service_info_list = g_list_append(*service_info_list, (void*)sp_info);
399 static void _myaccount_addaccount_get_account_type_info(const char* capability_filter, GList** sp_info_list)
402 MYACCOUNT_ERROR("sp_info_list is null\n");
406 if(capability_filter) {
407 if(!strcmp(capability_filter, "http://tizen.org/account/capability/tizen_email")){
408 account_type_query_by_provider_feature(_myaccount_addaccount_get_account_type_info_cb, "http://tizen.org/account/capability/email", (void*)sp_info_list);
410 account_type_query_by_provider_feature(_myaccount_addaccount_get_account_type_info_cb, capability_filter, (void*)sp_info_list);
414 account_type_foreach_account_type_from_db(_myaccount_addaccount_get_account_type_info_cb, (void*)sp_info_list);
418 static int _myaccount_ug_addaccount_compare(gconstpointer a, gconstpointer b)
420 addaccount_list_priv* sp_info_a = (addaccount_list_priv*)a;
421 addaccount_list_priv* sp_info_b = (addaccount_list_priv*)b;
423 return g_ascii_strcasecmp(sp_info_a->service_sname, sp_info_b->service_sname);
426 static int __myaccount_addaccount_populate_service_info(myaccount_appdata *ad)
430 //_myaccount_addaccount_get_csc_sp_list(ad->capability_filter, &ad->sp_info_list);
431 _myaccount_addaccount_get_account_type_info(ad->capability_filter, &ad->sorted_sp_list);
433 ad->sorted_sp_list = g_list_sort(ad->sorted_sp_list, (GCompareFunc)_myaccount_ug_addaccount_compare);
434 pkg_count = g_list_length(ad->sorted_sp_list);
439 static void _myaccount_ug_addaccount_gl_realized(void *data, Evas_Object *obj, void *ei)
441 Elm_Object_Item *it = NULL;
446 MYACCOUNT_ERROR("Realized event info is NULL!!! \n");
450 it = (Elm_Object_Item *)ei;
452 total_count = elm_genlist_items_count(obj);
453 index = elm_genlist_item_index_get(it);
455 if(index != 0 && index != total_count) {
456 /*Add account items. index 1 and last are the seperators*/
457 /* but you don't need to do something. winset support accessibility for default item */
459 /*Remove access for seperators*/
460 elm_object_item_access_unregister(ei);
463 if(total_count <= 3) {
464 //MYACCOUNT_VERBOSE("DO NOTHING only one add account item, total_count(%d) index(%d) !!! \n", total_count, index);
467 elm_object_item_signal_emit(ei, "elm,state,top", "");
468 } else if (index == (total_count-2)) {
469 elm_object_item_signal_emit(ei, "elm,state,bottom", "");
471 elm_object_item_signal_emit(ei, "elm,state,center", "");
476 static void _myaccount_ug_addaccount_gl_deleted(void *data, Evas_Object *obj, void *ei)
478 MYACCOUNT_ERROR("# _myaccount_ug_addaccount_gl_deleted\n");
479 myaccount_appdata *ad = myaccount_get_appdata();
480 myaccount_addaccount_free_priv_data(ad);
483 static Evas_Object * __myaccount_addaccount_create_genlist_layout(
484 Evas_Object *navi_bar)
486 Evas_Object *genlist;
488 addacc_list_itc.item_style = "type1";
489 addacc_list_itc.func.text_get = __myaccount_addaccount_gl_label_get;
490 addacc_list_itc.func.content_get = __myaccount_addaccount_icon_get;
491 addacc_list_itc.func.state_get = NULL;
492 addacc_list_itc.func.del = NULL;
494 genlist = elm_genlist_add(navi_bar);
495 evas_object_smart_callback_add(genlist, "realized", _myaccount_ug_addaccount_gl_realized, NULL);
496 evas_object_smart_callback_add(genlist, "delete", _myaccount_ug_addaccount_gl_deleted, NULL);
500 static Evas_Object *__myaccount_addaccount_append_genlist_item(
501 myaccount_appdata *ad, Evas_Object *genlist, int count)
504 MYACCOUNT_ERROR("__myaccount_addaccount_create_genlist returns NULL\n");
510 for(iter=ad->sorted_sp_list;iter!=NULL;iter=g_list_next(iter)) {
511 addaccount_list_priv* tmp = (addaccount_list_priv*)iter->data;
513 if(ad->capability_filter) {
514 /* Samsung account exception */
515 if(tmp->sp_type == MYACCOUNT_TYPE_SAMSUNG
516 && (!strcmp(ad->capability_filter, "http://tizen.org/account/capability/memo")
517 || !strcmp(ad->capability_filter, "http://tizen.org/account/capability/contact")
518 || !strcmp(ad->capability_filter, "http://tizen.org/account/capability/calendar"))) {
519 elm_genlist_item_append(genlist, &addacc_list_itc,
521 ELM_GENLIST_ITEM_NONE,
522 __myaccount_addaccount_gl_sel,
524 } else if( !strcmp(ad->capability_filter, "http://tizen.org/account/capability/tizen_email")) { /* Tizen email exception */
525 if(tmp->b_tizen_email) {
526 elm_genlist_item_append(genlist, &addacc_list_itc,
528 ELM_GENLIST_ITEM_NONE,
529 __myaccount_addaccount_gl_sel,
533 elm_genlist_item_append(genlist, &addacc_list_itc,
535 ELM_GENLIST_ITEM_NONE,
536 __myaccount_addaccount_gl_sel,
540 elm_genlist_item_append(genlist, &addacc_list_itc,
542 ELM_GENLIST_ITEM_NONE,
543 __myaccount_addaccount_gl_sel,
549 elm_genlist_block_count_set(genlist, count);
554 static Evas_Object *__myaccount_addaccount_create_genlist(
555 myaccount_appdata *ad, int count)
557 Evas_Object *genlist;
560 MYACCOUNT_ERROR("__myaccount_addaccount_create_genlist returns NULL\n");
564 genlist = __myaccount_addaccount_create_genlist_layout(ad->navi_bar);
566 return __myaccount_addaccount_append_genlist_item(ad, genlist, count);
569 static Evas_Object *__myaccount_addaccount_no_account(myaccount_appdata *ad, int count)
571 Evas_Object *no_account;
572 char no_content_text[100] = {0,};
575 MYACCOUNT_ERROR("__myaccount_addaccount_no_account returns NULL\n");
578 no_account = elm_layout_add(ad->navi_bar);
579 elm_layout_file_set(no_account, MA_NO_ACCOUNT_EDJ_NAME, "nocontents_layout");
581 elm_layout_theme_set(no_account, "layout", "nocontents", "default");
582 evas_object_size_hint_weight_set(no_account, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
583 evas_object_size_hint_align_set(no_account, EVAS_HINT_FILL, EVAS_HINT_FILL);
585 MA_SNPRINTF(no_content_text, sizeof(no_content_text), "<font=Sans:style=Regular color=#000000>%s</font>", dgettext(MA_UG_NAME, "IDS_MA_NPBODY_NO_ACCOUNT_PROVIDER_APPS_INSTALLED"));
586 elm_object_part_text_set(no_account, "elm.text", no_content_text);
588 /* left below line to future use */
589 //elm_object_part_text_set(no_account, "elm.help.text", "Please install account app to add account");
590 elm_layout_signal_emit(no_account, "text,disabled", "");
591 elm_layout_signal_emit(no_account, "align.center", "elm");
596 Eina_Bool __myaccount_addaccount_quit_cb( void *data,
597 Elm_Object_Item *it )
600 myaccount_appdata *priv = (myaccount_appdata*)data;
603 MYACCOUNT_DBUG("Add account list quit\n");
606 MYACCOUNT_ERROR("__myaccount_addaccount_quit_cb callback user data is null!!!\n");
610 if(priv->capability_filter && strlen(priv->capability_filter)){
612 if(!strcmp(priv->capability_filter, "http://tizen.org/account/capability/tizen_email")){
616 error_code = myaccount_common_get_account_cnt_by_appid(TIZEN_EMAIL_APPID, &cnt1);
617 error_code = myaccount_common_get_account_cnt_by_appid(EXCHANGE_UI_APPID, &cnt2);
618 error_code = myaccount_common_get_account_cnt_by_appid(GOOGLE_ACCOUNT_APPID, &cnt3);
619 count = cnt1+cnt2+cnt3;
621 error_code = myaccount_common_get_account_cnt_by_capability(priv->capability_filter, &count);
624 if (error_code != ACCOUNT_ERROR_NONE) {
625 MYACCOUNT_ERROR("__myaccount_addaccount_quit_cb: myaccount_common_get_all_account_cnt fail(%d) \n",
629 error_code = myaccount_common_get_all_account_cnt(&count, false);
630 if (error_code != ACCOUNT_ERROR_NONE) {
631 MYACCOUNT_ERROR("__myaccount_addaccount_quit_cb: myaccount_common_get_all_account_cnt fail(%d) \n",
636 /*destroy add genlist before pop it*/
638 if ((count > 0) && (priv->eMode == eMYACCOUNT_ACCOUNT_LIST)) {
639 MYACCOUNT_DBUG("# count > 0, elm_naviframe_item_pop return EINA_TRUE\n");
640 if (priv->add_genlist) {
641 evas_object_del(priv->add_genlist);
642 priv->add_genlist = NULL;
644 priv->prev_app_cnt = 0;
650 ui_gadget_h ug = priv->ug;
655 if (priv->add_genlist) {
656 evas_object_del(priv->add_genlist);
657 priv->add_genlist = NULL;
659 priv->prev_app_cnt = 0;
660 MYACCOUNT_DBUG("Add account list quit end\n");
665 void myaccount_addaccount_back_key_cb(void *data, Evas_Object *obj, void *event_info)
667 myaccount_appdata *ad = (myaccount_appdata*)data;
668 elm_naviframe_item_pop(ad->navi_bar);
671 void myaccount_addaccount_genlist_create(void *data)
673 myaccount_appdata *ad = data;
674 Evas_Object *genlist;
675 Evas_Object *l_button;
679 MYACCOUNT_ERROR("myaccount_addaccount_genlist_create myaccount_appdata is null\n");
683 service_cnt = __myaccount_addaccount_populate_service_info(ad);
684 ad->prev_app_cnt = service_cnt;
686 ad->add_genlist = genlist = __myaccount_addaccount_create_genlist(ad, service_cnt);
688 /* If there's no account provider, display no account view */
689 ad->add_genlist = genlist = __myaccount_addaccount_no_account(ad, service_cnt);
692 l_button = elm_button_add(ad->navi_bar);
693 elm_object_style_set(l_button , "naviframe/back_btn/default");
694 evas_object_smart_callback_add(l_button, "clicked", myaccount_addaccount_back_key_cb, ad);
696 ad->add_nf_it = elm_naviframe_item_push(ad->navi_bar,
697 dgettext(MA_UG_NAME, "IDS_MA_HEADER_ADD_ACCOUNT"),
698 l_button, NULL, genlist, NULL);
699 MYACCOUNT_DBUG("#elm_naviframe_item_pushed..");
700 elm_naviframe_item_pop_cb_set(ad->add_nf_it, __myaccount_addaccount_quit_cb, (void*)ad);
703 void myaccount_addaccount_create_view(myaccount_appdata *ad)
705 MYACCOUNT_DBUG("myaccount_addaccount_create_view start\n");
706 if (ad->add_genlist == NULL) {
707 MYACCOUNT_DBUG("Add account list start\n");
708 myaccount_addaccount_free_priv_data(ad);
709 myaccount_addaccount_genlist_create(ad);
713 void myaccount_addaccount_refresh_item_list(myaccount_appdata *ad)
718 MYACCOUNT_ERROR("no appdata!\n");
722 if(!ad->add_genlist) {
723 MYACCOUNT_ERROR("no genlist!\n");
727 /*check if app count changed or not, if not changed, then do not refresh current view*/
729 GList *sp_list = NULL;
730 _myaccount_addaccount_get_account_type_info(ad->capability_filter, &sp_list);
731 curr_cnt = g_list_length(sp_list);
733 if (ad->prev_app_cnt == curr_cnt) {
735 for (i = 0; i < curr_cnt; i++) {
736 addaccount_list_priv *info = g_list_nth_data(sp_list, i);
740 for (j = 0; j < curr_cnt; j++) {
741 addaccount_list_priv *prev_info = g_list_nth_data(ad->sorted_sp_list, j);
744 if (!g_strcmp0(prev_info->service_name, info->service_name)) {
746 //MYACCOUNT_DBUG("info->service_name[%s]", info->service_name);
753 for(it=sp_list;it!=NULL;it=g_list_next(it)) {
754 addaccount_list_priv* tmp = (addaccount_list_priv*)it->data;
757 MYACCOUNT_DBUG("ad->prev_app_cnt[%d], valid_cnt[%d]", ad->prev_app_cnt, valid_cnt);
758 if (ad->prev_app_cnt == valid_cnt) {
759 MYACCOUNT_DBUG("no change, no need to refresh genlist items!\n");
763 elm_genlist_clear(ad->add_genlist);
764 myaccount_addaccount_free_priv_data(ad);
765 count = __myaccount_addaccount_populate_service_info(ad);
766 ad->prev_app_cnt = count;
767 __myaccount_addaccount_append_genlist_item(ad, ad->add_genlist, count);