From: shubham kumar Date: Fri, 23 Dec 2016 09:27:14 +0000 (+0530) Subject: [TSAM-11548]redownload file issue resolved X-Git-Tag: submit/tizen/20170524.060757~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cab680bd6a25fc440239ef6e186c635bc7f1516;p=profile%2Fmobile%2Fapps%2Fnative%2Fmyfiles.git [TSAM-11548]redownload file issue resolved Change-Id: Id490d5da16a641381e56c40ca9a22db513872207 Signed-off-by: shubham kumar --- diff --git a/inc/mf-object-conf.h b/inc/mf-object-conf.h index 64e34a2..39c6d6b 100644 --- a/inc/mf-object-conf.h +++ b/inc/mf-object-conf.h @@ -100,6 +100,7 @@ typedef struct { i18n_udate modify_time; fsNodeInfo *pNode; char *downloaded_url; + int download_id; } mfItemData_s; typedef enum __eMfViewStyle { diff --git a/src/common/mf-callback.c b/src/common/mf-callback.c index 0e5977b..da4d970 100644 --- a/src/common/mf-callback.c +++ b/src/common/mf-callback.c @@ -974,18 +974,19 @@ void mf_callback_redownload_file_cb(void *data, Evas_Object * obj, snprintf(where, 1024, "id = '%d'", id); mf_debug("where clauses are %s", where); - result = data_control_sql_delete(ap->provider_h, where, &req_id); +// + mf_debug("path is %s and id is %d", path, id); char *tmp = strrchr(path, '/'); if (!tmp) { return; } memset(tmp, 0, sizeof(tmp)); - mf_debug("path is %s and id is %d", path, id); if (g_strcmp0(label, mf_util_get_text(MF_LABEL_REMOVE)) == 0) { + result = data_control_sql_delete(ap->provider_h, where, &req_id); mf_debug("remove button pressed"); return; } @@ -3750,7 +3751,7 @@ static void __mf_callback_download_confirm_delete(void *data, EINA_LIST_FOREACH(list, l, item) { if (item) { char where[1024] = { 0, }; - snprintf(where, 1024, "url = '%s'", item->downloaded_url); + snprintf(where, 1024, "id = '%d'", item->download_id); mf_debug("where clauses are %s", where); result = data_control_sql_delete(ap->provider_h, where, &req_id); @@ -6542,8 +6543,8 @@ void mf_sql_delete_response_cb(int request_id, data_control_h provider, Eina_List *edit_list = ap->download_edit_list; EINA_LIST_FOREACH(file_list, complete_list, node) { EINA_LIST_FOREACH(edit_list, editable_list, pNode) { - if (pNode && node && pNode->downloaded_url && node->url - && !strcmp(pNode->downloaded_url, node->url)) { + if (pNode && node && pNode->download_id && node->id + && (pNode->download_id == node->id)) { ap->mf_FileOperation.downloaded_list = eina_list_remove(ap->mf_FileOperation. downloaded_list, node); diff --git a/src/widget/mf-genlist.c b/src/widget/mf-genlist.c index 0ca1358..ce4e940 100644 --- a/src/widget/mf-genlist.c +++ b/src/widget/mf-genlist.c @@ -1264,6 +1264,7 @@ void mf_genlist_create_downloaded_list_default_style(Evas_Object * mf_debug("current mount path is : %s", real_name); mf_genlist_create_data(&m_TempItem, real_name, data); m_TempItem->downloaded_url = strdup(node->url); + m_TempItem->download_id = node->id; it = elm_genlist_item_append(pGenlist, ap->mf_gl_style.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,