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.main.left")) {
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_FACEBOOK :
111 case MYACCOUNT_TYPE_EXCHANGE :
112 myaccount_common_launch_application(
113 MYACCOUNT_REQUEST_SIGNIN,
114 strdup(service->package_name),
121 case MYACCOUNT_TYPE_GOOGLE :
122 MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", "gmail");
123 myaccount_common_launch_application(
124 MYACCOUNT_REQUEST_SIGNIN,
125 strdup(service->package_name),
132 // case MYACCOUNT_TYPE_MSN :
133 // MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", "msn");
134 // myaccount_common_launch_application(
135 // MYACCOUNT_REQUEST_SIGNIN,
136 // strdup(service->package_name),
143 case MYACCOUNT_TYPE_OTHER:
144 MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", "others");
145 myaccount_common_launch_application(
146 MYACCOUNT_REQUEST_SIGNIN,
147 strdup(service->package_name),
154 case MYACCOUNT_TYPE_CSC:
155 MA_SNPRINTF(email_sp, sizeof(email_sp), "%s", service->service_name);
156 myaccount_common_launch_application(
157 MYACCOUNT_REQUEST_SIGNIN,
158 strdup(service->package_name),
166 if(myaccount_common_launch_application(
167 MYACCOUNT_REQUEST_SIGNIN,
168 strdup(service->package_name),
173 ad) != APP_CONTROL_ERROR_NONE ) {
174 MYACCOUNT_ERROR("__myaccount_addaccount_gl_sel : Failed to launch application\n");
175 myaccount_common_set_item_selected_state(false);
185 static Evas_Object *__myaccount_addaccount_icon_get( void *data,
186 Evas_Object *obj, const char *part)
188 char tempbuf[PATH_MAX];
189 Evas_Object *icon = NULL;
190 addaccount_list_priv *service_item = (addaccount_list_priv*)data;
191 Evas_Object *ic = NULL;
194 MYACCOUNT_ERROR(" __myaccount_addaccount_icon_get: Data is NULL\n");
197 memset(tempbuf, 0, sizeof(char)*PATH_MAX);
199 if (!strcmp(part, "elm.icon.1")) {
200 if (strlen(service_item->icon_path) > 0) {
201 MA_STRNCPY(tempbuf, service_item->icon_path, sizeof(tempbuf));
203 MA_STRNCPY(tempbuf, "A01_2_Icon_default.png", sizeof(tempbuf));
205 ic = elm_layout_add(obj);
206 elm_layout_theme_set(ic, "layout", "list/B/type.2", "default");
208 icon = elm_image_add(obj);
209 if (strstr(tempbuf, "/"))
210 elm_image_file_set(icon, tempbuf, NULL);
212 elm_image_file_set(icon, MA_IMAGE_EDJ_NAME, tempbuf);
214 elm_layout_content_set(ic, "elm.swallow.content", icon);
219 void myaccount_addaccount_free_priv_data(myaccount_appdata *appdata)
222 myaccount_appdata *ad = (myaccount_appdata *)appdata;
225 MYACCOUNT_ERROR("No appdata!!\n");
229 for(it=ad->sorted_sp_list;it!=NULL;it=g_list_next(it)) {
230 addaccount_list_priv* tmp = (addaccount_list_priv*)it->data;
234 ad->sorted_sp_list = NULL;
237 static addaccount_list_priv*
238 _myaccount_addaccount_create_priv_item()
240 addaccount_list_priv* sp_info = NULL;
241 sp_info = (addaccount_list_priv*)calloc(1,sizeof(addaccount_list_priv));
243 MYACCOUNT_ERROR("memory allocation fail\n");
246 memset(sp_info, 0x00, sizeof(addaccount_list_priv));
250 static bool _myaccount_addaccount_get_account_type_info_cb(account_type_h account_type, void *user_data)
252 GList **service_info_list = (GList **)user_data;
253 char* type_buf = NULL;
254 int type_int = -1, ret = -1;
255 addaccount_list_priv* sp_info = NULL;
257 if(account_type == NULL) {
258 MYACCOUNT_ERROR(" account type handle is NULL \n");
262 sp_info = _myaccount_addaccount_create_priv_item();
264 if(sp_info == NULL) {
265 MYACCOUNT_ERROR(" sp_info is NULL \n");
269 ret = account_type_get_app_id(account_type, &type_buf);
270 if(ret == ACCOUNT_ERROR_NONE ) {
272 MA_STRNCPY(sp_info->package_name, type_buf,
273 sizeof(sp_info->package_name));
275 MYACCOUNT_ERROR("No appid available\n");
278 MYACCOUNT_ERROR("account_type_get_app_id return(%x)\n", ret);
280 MA_MEMFREE(type_buf);
282 myaccount_appdata* ad = NULL;
283 ad = myaccount_get_appdata();
286 if(ad->called_from && !strcmp(ad->called_from, "setup_wizard")){
287 MYACCOUNT_ERROR("FROM SETUP WIZARD\n");
288 if(!strcmp(sp_info->package_name, SAMSUNG_ACCOUNT_APPID)) {
291 } else if(!strcmp(sp_info->package_name, TIZEN_ACCOUNT_APPID)) {
297 MYACCOUNT_ERROR("app data is null\n");
300 if(!strcmp(sp_info->package_name, "email-setting-efl")) {
303 sp_info = _myaccount_addaccount_create_priv_item();
304 if(sp_info == NULL) {
305 MYACCOUNT_ERROR(" sp_info is NULL \n");
309 MA_STRNCPY(sp_info->service_name,
310 dgettext(MA_UG_NAME, "IDS_COM_BODY_EMAIL"),
311 sizeof(sp_info->service_name));
312 MA_SNPRINTF(sp_info->service_sname, sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_3, sp_info->service_name);
313 MA_STRNCPY(sp_info->package_name,
315 sizeof(sp_info->package_name));
316 //myaccount_common_get_icon_by_name("email",
317 // sp_info->icon_path);
319 ret = account_type_get_icon_path(account_type, &type_buf);
320 if(ret == ACCOUNT_ERROR_NONE ) {
322 MA_STRNCPY(sp_info->icon_path, type_buf,
323 sizeof(sp_info->icon_path));
325 MYACCOUNT_ERROR("No icon path available\n");
328 MYACCOUNT_ERROR("account_type_get_app_id return(%x)\n", ret);
330 MA_MEMFREE(type_buf);
332 sp_info->sp_type = MYACCOUNT_TYPE_OTHER;
333 sp_info->b_tizen_email = TRUE;
334 *service_info_list = g_list_append(*service_info_list, (void*)sp_info);
337 } else if(!strcmp(sp_info->package_name, "activesync-ui")) {
338 sp_info->b_tizen_email = TRUE;
339 } else if(!strcmp(sp_info->package_name, "com.samsung.rcs-im")
340 || !strcmp(sp_info->package_name, "ims-service")) {
343 } else if(!strcmp(sp_info->package_name, GOOGLE_ACCOUNT_APPID)) {
344 sp_info->b_tizen_email = TRUE;
347 ret = account_type_get_icon_path(account_type, &type_buf);
348 if(ret == ACCOUNT_ERROR_NONE ) {
350 MA_STRNCPY(sp_info->icon_path, type_buf,
351 sizeof(sp_info->icon_path));
353 MYACCOUNT_ERROR("No icon path available\n");
356 MYACCOUNT_ERROR("account_type_get_app_id return(%x)\n", ret);
358 MA_MEMFREE(type_buf);
360 char* provider_name = NULL;
362 if(ad && ad->current_language){
364 if(!strcmp(ad->current_language, "en_US")){
365 ret = account_type_get_label_by_locale(account_type, "en_GB", &provider_name);
367 ret = account_type_get_label_by_locale(account_type, ad->current_language, &provider_name);
371 if(ret != ACCOUNT_ERROR_NONE){
372 /* fallback scenario */
373 ret = account_type_get_label_by_locale(account_type, "default", &provider_name);
374 if(ret != ACCOUNT_ERROR_NONE){
375 MYACCOUNT_SLOGE("No service name(%s)\n", sp_info->package_name);
381 MA_STRNCPY(sp_info->service_name, provider_name,
382 sizeof(sp_info->service_name));
384 MA_MEMFREE(provider_name);
386 if(!strcmp(sp_info->package_name, SAMSUNG_ACCOUNT_APPID)) {
387 MA_SNPRINTF(sp_info->service_sname,
388 sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_1, sp_info->service_name);
389 } else if(!strcmp(sp_info->package_name, TIZEN_ACCOUNT_APPID)){
390 MA_SNPRINTF(sp_info->service_sname,
391 sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_1, sp_info->service_name);
393 MA_SNPRINTF(sp_info->service_sname,
394 sizeof(sp_info->service_sname), "%s%s", SORT_PRIOR_3, sp_info->service_name);
397 account_type_get_multiple_account_support(account_type, &type_int);
398 sp_info->multiple_account_support = type_int;
401 && account_query_account_by_package_name(myaccount_add_account_by_package_name_cb, sp_info->package_name, NULL) == ACCOUNT_ERROR_NONE) {
406 *service_info_list = g_list_append(*service_info_list, (void*)sp_info);
411 static void _myaccount_addaccount_get_account_type_info(const char* capability_filter, GList** sp_info_list)
415 MYACCOUNT_ERROR("sp_info_list is null\n");
419 ret = account_connect();
420 if(ret != ACCOUNT_ERROR_NONE){
421 MYACCOUNT_ERROR("account database cannot be connected\n");
425 if(capability_filter) {
426 if(!strcmp(capability_filter, "http://tizen.org/account/capability/tizen_email")){
427 account_type_query_by_provider_feature(_myaccount_addaccount_get_account_type_info_cb, "http://tizen.org/account/capability/email", (void*)sp_info_list);
429 account_type_query_by_provider_feature(_myaccount_addaccount_get_account_type_info_cb, capability_filter, (void*)sp_info_list);
433 account_type_foreach_account_type_from_db(_myaccount_addaccount_get_account_type_info_cb, (void*)sp_info_list);
435 ret = account_disconnect();
436 if(ret != ACCOUNT_ERROR_NONE){
437 MYACCOUNT_ERROR("account database cannot be connected\n");
442 static int _myaccount_ug_addaccount_compare(gconstpointer a, gconstpointer b)
444 addaccount_list_priv* sp_info_a = (addaccount_list_priv*)a;
445 addaccount_list_priv* sp_info_b = (addaccount_list_priv*)b;
447 return g_ascii_strcasecmp(sp_info_a->service_sname, sp_info_b->service_sname);
450 static int __myaccount_addaccount_populate_service_info(myaccount_appdata *ad)
454 //_myaccount_addaccount_get_csc_sp_list(ad->capability_filter, &ad->sp_info_list);
455 _myaccount_addaccount_get_account_type_info(ad->capability_filter, &ad->sorted_sp_list);
457 ad->sorted_sp_list = g_list_sort(ad->sorted_sp_list, (GCompareFunc)_myaccount_ug_addaccount_compare);
458 pkg_count = g_list_length(ad->sorted_sp_list);
463 static void _myaccount_ug_addaccount_gl_realized(void *data, Evas_Object *obj, void *ei)
465 Elm_Object_Item *it = NULL;
470 MYACCOUNT_ERROR("Realized event info is NULL!!! \n");
474 it = (Elm_Object_Item *)ei;
476 total_count = elm_genlist_items_count(obj);
477 index = elm_genlist_item_index_get(it);
479 if(index != 0 && index != total_count) {
480 /*Add account items. index 1 and last are the seperators*/
481 /* but you don't need to do something. winset support accessibility for default item */
483 /*Remove access for seperators*/
484 elm_object_item_access_unregister(ei);
487 if(total_count <= 3) {
488 //MYACCOUNT_VERBOSE("DO NOTHING only one add account item, total_count(%d) index(%d) !!! \n", total_count, index);
491 elm_object_item_signal_emit(ei, "elm,state,top", "");
492 } else if (index == (total_count-2)) {
493 elm_object_item_signal_emit(ei, "elm,state,bottom", "");
495 elm_object_item_signal_emit(ei, "elm,state,center", "");
500 static void _myaccount_ug_addaccount_gl_deleted(void *data, Evas_Object *obj, void *ei)
502 MYACCOUNT_ERROR("# _myaccount_ug_addaccount_gl_deleted\n");
503 myaccount_appdata *ad = myaccount_get_appdata();
504 myaccount_addaccount_free_priv_data(ad);
507 static Evas_Object * __myaccount_addaccount_create_genlist_layout(
508 Evas_Object *navi_bar)
510 Evas_Object *genlist;
512 addacc_list_itc.item_style = "1line";
513 addacc_list_itc.func.text_get = __myaccount_addaccount_gl_label_get;
514 addacc_list_itc.func.content_get = __myaccount_addaccount_icon_get;
515 addacc_list_itc.func.state_get = NULL;
516 addacc_list_itc.func.del = NULL;
518 genlist = elm_genlist_add(navi_bar);
519 evas_object_smart_callback_add(genlist, "realized", _myaccount_ug_addaccount_gl_realized, NULL);
520 evas_object_smart_callback_add(genlist, "delete", _myaccount_ug_addaccount_gl_deleted, NULL);
524 static Evas_Object *__myaccount_addaccount_append_genlist_item(
525 myaccount_appdata *ad, Evas_Object *genlist, int count)
528 MYACCOUNT_ERROR("__myaccount_addaccount_create_genlist returns NULL\n");
534 for(iter=ad->sorted_sp_list;iter!=NULL;iter=g_list_next(iter)) {
535 addaccount_list_priv* tmp = (addaccount_list_priv*)iter->data;
537 if(ad->capability_filter) {
538 /* Samsung account exception */
539 if(tmp->sp_type == MYACCOUNT_TYPE_SAMSUNG
540 && (!strcmp(ad->capability_filter, "http://tizen.org/account/capability/memo")
541 || !strcmp(ad->capability_filter, "http://tizen.org/account/capability/contact")
542 || !strcmp(ad->capability_filter, "http://tizen.org/account/capability/calendar"))) {
543 elm_genlist_item_append(genlist, &addacc_list_itc,
545 ELM_GENLIST_ITEM_NONE,
546 __myaccount_addaccount_gl_sel,
548 } else if( !strcmp(ad->capability_filter, "http://tizen.org/account/capability/tizen_email")) { /* Tizen email exception */
549 if(tmp->b_tizen_email) {
550 elm_genlist_item_append(genlist, &addacc_list_itc,
552 ELM_GENLIST_ITEM_NONE,
553 __myaccount_addaccount_gl_sel,
557 elm_genlist_item_append(genlist, &addacc_list_itc,
559 ELM_GENLIST_ITEM_NONE,
560 __myaccount_addaccount_gl_sel,
564 elm_genlist_item_append(genlist, &addacc_list_itc,
566 ELM_GENLIST_ITEM_NONE,
567 __myaccount_addaccount_gl_sel,
573 elm_genlist_block_count_set(genlist, count);
578 static Evas_Object *__myaccount_addaccount_create_genlist(
579 myaccount_appdata *ad, int count)
581 Evas_Object *genlist;
584 MYACCOUNT_ERROR("__myaccount_addaccount_create_genlist returns NULL\n");
588 genlist = __myaccount_addaccount_create_genlist_layout(ad->navi_bar);
590 return __myaccount_addaccount_append_genlist_item(ad, genlist, count);
593 static Evas_Object *__myaccount_addaccount_no_account(myaccount_appdata *ad, int count)
595 Evas_Object *no_account;
598 MYACCOUNT_ERROR("__myaccount_addaccount_no_account returns NULL\n");
601 no_account = elm_layout_add(ad->navi_bar);
602 elm_layout_file_set(no_account, MA_NO_ACCOUNT_EDJ_NAME, "nocontents_layout");
604 elm_layout_theme_set(no_account, "layout", "nocontents", "default");
605 evas_object_size_hint_weight_set(no_account, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
606 evas_object_size_hint_align_set(no_account, EVAS_HINT_FILL, EVAS_HINT_FILL);
607 elm_object_part_text_set(no_account, "elm.text", dgettext(MA_UG_NAME, "IDS_MA_NPBODY_NO_ACCOUNT_PROVIDER_APPS_INSTALLED"));
608 /* left below line to future use */
609 //elm_object_part_text_set(no_account, "elm.help.text", "Please install account app to add account");
610 elm_layout_signal_emit(no_account, "text,disabled", "");
611 elm_layout_signal_emit(no_account, "align.center", "elm");
616 Eina_Bool __myaccount_addaccount_quit_cb( void *data,
617 Elm_Object_Item *it )
620 myaccount_appdata *priv = (myaccount_appdata*)data;
623 MYACCOUNT_DBUG("Add account list quit\n");
626 MYACCOUNT_ERROR("__myaccount_addaccount_quit_cb callback user data is null!!!\n");
630 if(priv->capability_filter && strlen(priv->capability_filter)){
632 if(!strcmp(priv->capability_filter, "http://tizen.org/account/capability/tizen_email")){
636 error_code = myaccount_common_get_account_cnt_by_appid(TIZEN_EMAIL_APPID, &cnt1);
637 error_code = myaccount_common_get_account_cnt_by_appid(EXCHANGE_UI_APPID, &cnt2);
638 error_code = myaccount_common_get_account_cnt_by_appid(GOOGLE_ACCOUNT_APPID, &cnt3);
639 count = cnt1+cnt2+cnt3;
641 error_code = myaccount_common_get_account_cnt_by_capability(priv->capability_filter, &count);
644 if (error_code != ACCOUNT_ERROR_NONE) {
645 MYACCOUNT_ERROR("__myaccount_addaccount_quit_cb: myaccount_common_get_all_account_cnt fail(%d) \n",
649 error_code = myaccount_common_get_all_account_cnt(&count);
650 if (error_code != ACCOUNT_ERROR_NONE) {
651 MYACCOUNT_ERROR("__myaccount_addaccount_quit_cb: myaccount_common_get_all_account_cnt fail(%d) \n",
656 /*destroy add genlist before pop it*/
658 if ((count > 0) && (priv->eMode == eMYACCOUNT_ACCOUNT_LIST)) {
659 MYACCOUNT_DBUG("# count > 0, elm_naviframe_item_pop return EINA_TRUE\n");
660 if (priv->add_genlist) {
661 evas_object_del(priv->add_genlist);
662 priv->add_genlist = NULL;
664 priv->prev_app_cnt = 0;
670 ui_gadget_h ug = priv->ug;
675 if (priv->add_genlist) {
676 evas_object_del(priv->add_genlist);
677 priv->add_genlist = NULL;
679 priv->prev_app_cnt = 0;
680 MYACCOUNT_DBUG("Add account list quit end\n");
685 void myaccount_addaccount_genlist_create(void *data)
687 myaccount_appdata *ad = data;
688 Evas_Object *genlist;
689 Evas_Object *l_button;
693 MYACCOUNT_ERROR("myaccount_addaccount_genlist_create myaccount_appdata is null\n");
697 service_cnt = __myaccount_addaccount_populate_service_info(ad);
698 ad->prev_app_cnt = service_cnt;
700 ad->add_genlist = genlist = __myaccount_addaccount_create_genlist(ad, service_cnt);
702 /* If there's no account provider, display no account view */
703 ad->add_genlist = genlist = __myaccount_addaccount_no_account(ad, service_cnt);
706 l_button = elm_button_add(ad->navi_bar);
707 elm_object_style_set(l_button , "naviframe/back_btn/default");
709 ad->add_nf_it = elm_naviframe_item_push(ad->navi_bar,
710 dgettext(MA_UG_NAME, "IDS_MA_HEADER_ADD_ACCOUNT"),
711 l_button, NULL, genlist, NULL);
712 MYACCOUNT_DBUG("#elm_naviframe_item_pushed..");
713 elm_naviframe_item_pop_cb_set(ad->add_nf_it, __myaccount_addaccount_quit_cb, (void*)ad);
716 void myaccount_addaccount_create_view(myaccount_appdata *ad)
718 MYACCOUNT_DBUG("myaccount_addaccount_create_view start\n");
719 if (ad->add_genlist == NULL) {
720 MYACCOUNT_DBUG("Add account list start\n");
721 myaccount_addaccount_free_priv_data(ad);
722 myaccount_addaccount_genlist_create(ad);
726 void myaccount_addaccount_refresh_item_list(myaccount_appdata *ad)
731 MYACCOUNT_ERROR("no appdata!\n");
735 if(!ad->add_genlist) {
736 MYACCOUNT_ERROR("no genlist!\n");
740 /*check if app count changed or not, if not changed, then do not refresh current view*/
742 GList *sp_list = NULL;
743 _myaccount_addaccount_get_account_type_info(ad->capability_filter, &sp_list);
744 curr_cnt = g_list_length(sp_list);
746 if (ad->prev_app_cnt == curr_cnt) {
748 for (i = 0; i < curr_cnt; i++) {
749 addaccount_list_priv *info = g_list_nth_data(sp_list, i);
753 for (j = 0; j < curr_cnt; j++) {
754 addaccount_list_priv *prev_info = g_list_nth_data(ad->sorted_sp_list, j);
757 if (!g_strcmp0(prev_info->service_name, info->service_name)) {
759 //MYACCOUNT_DBUG("info->service_name[%s]", info->service_name);
766 for(it=sp_list;it!=NULL;it=g_list_next(it)) {
767 addaccount_list_priv* tmp = (addaccount_list_priv*)it->data;
770 MYACCOUNT_DBUG("ad->prev_app_cnt[%d], valid_cnt[%d]", ad->prev_app_cnt, valid_cnt);
771 if (ad->prev_app_cnt == valid_cnt) {
772 MYACCOUNT_DBUG("no change, no need to refresh genlist items!\n");
776 elm_genlist_clear(ad->add_genlist);
777 myaccount_addaccount_free_priv_data(ad);
778 count = __myaccount_addaccount_populate_service_info(ad);
779 ad->prev_app_cnt = count;
780 __myaccount_addaccount_append_genlist_item(ad, ad->add_genlist, count);