[TSAM-11548]redownload file issue resolved 77/106877/1
authorshubham kumar <shubham.srib@samsung.com>
Fri, 23 Dec 2016 09:27:14 +0000 (14:57 +0530)
committershubham kumar <shubham.srib@samsung.com>
Fri, 23 Dec 2016 09:27:14 +0000 (14:57 +0530)
Change-Id: Id490d5da16a641381e56c40ca9a22db513872207
Signed-off-by: shubham kumar <shubham.srib@samsung.com>
inc/mf-object-conf.h
src/common/mf-callback.c
src/widget/mf-genlist.c

index 64e34a2..39c6d6b 100644 (file)
@@ -100,6 +100,7 @@ typedef struct {
        i18n_udate modify_time;
        fsNodeInfo *pNode;
        char *downloaded_url;
+       int download_id;
 } mfItemData_s;
 
 typedef enum __eMfViewStyle {
index 0e5977b..da4d970 100644 (file)
@@ -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);
index 0ca1358..ce4e940 100644 (file)
@@ -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,