From: shubham kumar Date: Thu, 20 Apr 2017 08:10:42 +0000 (+0530) Subject: [UX IMPL]Hierarchical Back in myfiles implemented X-Git-Tag: submit/tizen/20170524.060757^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F126138%2F3;p=profile%2Fmobile%2Fapps%2Fnative%2Fmyfiles.git [UX IMPL]Hierarchical Back in myfiles implemented Change-Id: Id79af27af542da84b887d22a74029d7c972543a4 Signed-off-by: shubham kumar --- diff --git a/inc/mf-main.h b/inc/mf-main.h index 4e9067a..90bea15 100644 --- a/inc/mf-main.h +++ b/inc/mf-main.h @@ -364,6 +364,7 @@ struct appdata { Eina_List *download_edit_list; Eina_List *search_list; Eina_List *edit_search_list; + Eina_List *history; char *nTemp_entry; Evas_Object *label; char *file_name; diff --git a/inc/mf-util.h b/inc/mf-util.h index 199d01f..ead9657 100644 --- a/inc/mf-util.h +++ b/inc/mf-util.h @@ -369,6 +369,7 @@ int mf_util_get_internal_storage_id(void); void mf_file_decompression_start(void *data); void mf_file_compression_start(void *data); void mf_util_to_lower(char *str); +void mf_util_history_list_clear(void *data); bool mf_util_get_supported_storage_cb(int storageId, storage_type_e type, storage_state_e state, diff --git a/src/common/mf-callback.c b/src/common/mf-callback.c index e51e55b..114d721 100644 --- a/src/common/mf-callback.c +++ b/src/common/mf-callback.c @@ -5177,7 +5177,21 @@ void mf_callback_backbutton_clicked_cb(void *data, Evas_Object * obj, ap->mf_Status.entry_more = MORE_DEFAULT; } } else { - mf_callback_upper_click_cb(ap, NULL, NULL); + mf_debug("called to delete the top"); + char *top_item = (char *)eina_list_nth(ap->history, 0); + if (top_item) { + ap->history = eina_list_remove(ap->history, top_item); + SAFE_FREE_CHAR(top_item); + } + char *curr = (char *)eina_list_nth(ap->history, 0); + if (curr && !strncmp(curr, "main_view", strlen(curr))) { + ap->mf_Status.view_type = 1; + } else if(curr) { + mf_debug("curr path is %s", curr); + ap->mf_Status.path = NULL; + ap->mf_Status.path = g_string_new(curr); + } + mf_view_update(ap); } } else if (ap->mf_Status.more == MORE_EDIT_ADD_SHORTCUT) { //mf_callback_upper_click_cb(ap, NULL, NULL); diff --git a/src/common/mf-util.c b/src/common/mf-util.c index b1309e4..da691ac 100644 --- a/src/common/mf-util.c +++ b/src/common/mf-util.c @@ -107,6 +107,21 @@ bool mf_util_get_supported_storage_cb(int storageId, storage_type_e type, return true; } +void mf_util_history_list_clear(void *data) +{ + struct appdata *ap = (struct appdata *)data; + MF_CHECK(ap); + char *p = NULL; + Eina_List *list; + EINA_LIST_FOREACH(ap->history, list, p) { + if (p) { + SAFE_FREE_CHAR(p); + } + } + eina_list_free(ap->history); + ap->history = NULL; +} + /****************************** ** Prototype : __mf_util_is_mmc_supported ** Description : diff --git a/src/mf-main.c b/src/mf-main.c index af51b7c..58aab91 100644 --- a/src/mf-main.c +++ b/src/mf-main.c @@ -731,6 +731,8 @@ bool __mf_main_create_app(void *data) ap->mf_Status.b_run_background = false; + ap->history = eina_list_prepend(ap->history, strdup("main_view")); + mf_initialize_datacontrol_consumer(ap); MF_TRACE_END; @@ -1051,10 +1053,10 @@ void __mf_main_terminate_app(void *data) mf_edit_folder_list_clear(); mf_edit_file_list_clear(); + mf_util_history_list_clear(ap); mf_fs_monitor_destory(); - //mf_callback_imf_state_callback_del(ap); mf_util_free_eina_list_with_data(&ap->mf_FileOperation.folder_list, MYFILE_TYPE_FSNODE); mf_util_free_eina_list_with_data(&ap->mf_FileOperation.file_list, diff --git a/src/widget/mf-view.c b/src/widget/mf-view.c index f361693..c6e5080 100644 --- a/src/widget/mf-view.c +++ b/src/widget/mf-view.c @@ -276,7 +276,20 @@ void mf_view_refresh(void *data) mf_error(">>>>>>>>>>>> path is [%s]", ap->mf_Status.path->str); mf_error (">>>>>>>>>>>> ap->mf_Status.more =[%d], ap->mf_Status.view_type =[%d]", - ap->mf_Status.more, ap->mf_Status.view_type); + ap->mf_Status.more, ap->mf_Status.view_type); + char *top_item = (char *)eina_list_nth(ap->history, 0); + + + mf_debug("top item is %s and path is %s and length of top_item %d and path is %d", top_item, ap->mf_Status.path->str, + strlen(top_item), strlen(ap->mf_Status.path->str)); + + + if (!strncmp(top_item, "main_view", strlen(top_item)) || strncmp(top_item, ap->mf_Status.path->str, strlen(ap->mf_Status.path->str)) + || strncmp(top_item, ap->mf_Status.path->str, strlen(top_item))) { + if (!(ap->mf_Status.view_type == mf_view_root) && ap->mf_Status.more == MORE_DEFAULT) { + ap->history = eina_list_prepend(ap->history, strdup(ap->mf_Status.path->str)); + } + } mf_view_refresh_thumbnail_destroy(); mf_error();