From: Hyoyoung Chang Date: Tue, 8 Feb 2011 12:09:37 +0000 (+0900) Subject: bugfix saving recent history item X-Git-Tag: 2.0_alpha~130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b72054348ba82f7adb740b66e0341573c46d88fb;p=framework%2Fuifw%2Fcbhm.git bugfix saving recent history item --- diff --git a/src/clipdrawer.c b/src/clipdrawer.c index ff8bb25..fdc6f5d 100644 --- a/src/clipdrawer.c +++ b/src/clipdrawer.c @@ -311,14 +311,12 @@ Evas_Object* _grid_icon_get(const void *data, Evas_Object *obj, const char *part return ti->delbtn; } */ - return NULL; } static void _grid_longpress(void *data, Evas_Object *obj, void *event_info) { struct appdata *ad = data; - clipdrawer_change_mode(ad); } static void _grid_click_paste(void *data, Evas_Object *obj, void *event_info) diff --git a/src/storage.c b/src/storage.c index e654522..1f5efa8 100644 --- a/src/storage.c +++ b/src/storage.c @@ -94,7 +94,6 @@ unsigned int get_storage_serial_code(void *data) int adding_item_to_storage(void *data, int pos, char *idata) { // struct appdata *ad = data; - if (!g_storage_file) { DTRACE("g_storage_file is null\n"); diff --git a/src/xcnphandler.c b/src/xcnphandler.c index a43bec2..2e129c2 100755 --- a/src/xcnphandler.c +++ b/src/xcnphandler.c @@ -116,16 +116,15 @@ int add_to_storage_buffer(void *data, char *src, int len) if (len <= 0) return -1; -// if (g_lastest_content == NULL) -// g_lastest_content = malloc(sizeof(char)*(HISTORY_QUEUE_ITEM_SIZE)); + if (g_lastest_content != NULL) + free(g_lastest_content); + g_lastest_content = malloc(sizeof(char)*(len+1)); if (g_history_pos >= HISTORY_QUEUE_MAX_ITEMS) g_history_pos = 0; // FIXME: remove g_lasteset_content - //strcpy(g_lastest_content, src); -// memcpy(g_lastest_content, src, len); -// g_lastest_content[len] = '\0'; - g_lastest_content = src; + memcpy(g_lastest_content, src, len); + g_lastest_content[len] = '\0'; adding_item_to_storage(ad, g_history_pos, g_lastest_content); increment_current_history_position(); @@ -239,8 +238,8 @@ int get_selection_content(void *data) unesc_len = 0; #endif + #ifdef _DEMO - add_to_storage_buffer(ad, cbbuf, cbitems); DTRACE("len = %ld, data = %s\n", cbitems, cbbuf); if (cbbuf != NULL) @@ -292,6 +291,7 @@ int get_selection_content(void *data) } else { + DTRACE("clipdrawer add string = %s\n", unesc); add_to_storage_buffer(ad, unesc, unesc_len); clipdrawer_add_item(unesc, GI_TEXT); }