bugfix saving recent history item
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Tue, 8 Feb 2011 12:09:37 +0000 (21:09 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Tue, 8 Feb 2011 12:09:37 +0000 (21:09 +0900)
src/clipdrawer.c
src/storage.c
src/xcnphandler.c

index ff8bb25..fdc6f5d 100644 (file)
@@ -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)
index e654522..1f5efa8 100644 (file)
@@ -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");
index a43bec2..2e129c2 100755 (executable)
@@ -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);
        }