woring on history
authorgadomska_anna <gadomska.anna@gmail.com>
Mon, 12 Feb 2007 13:30:40 +0000 (13:30 +0000)
committergadomska_anna <gadomska.anna@gmail.com>
Mon, 12 Feb 2007 13:30:40 +0000 (13:30 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@77 5bde0345-f819-0410-ac75-e5045f9217cc

src/gui/src/ws_gui_callbacks.c

index baa6973..2ccb695 100644 (file)
@@ -669,16 +669,17 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
                {
                        while (tmp != NULL) 
                        {
-                               //if (ws_gui_app->bookmark_mode =
-                               g_array_remove_index(
-                               ws_gui_app->ws_gui_history, 
-                               i);
                                g_array_remove_index(
                                ws_gui_app->ws_gui_history_list, 
                                i);
                                g_array_remove_index(
                                ws_gui_app->ws_gui_history_iter, 
                                i);
+
+                               
+                               g_array_remove_index(
+                               ws_gui_app->ws_gui_history, 
+                               i);
                                
                                tmp = g_array_index(
                                      ws_gui_app->ws_gui_history, 
@@ -690,21 +691,19 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
                ws_gui_app->ws_gui_history_cur_pos ++;
        
                
-               
-               if (ws_gui_app->history_flag == FALSE)
+               if (ws_gui_app->bookmark_mode == FALSE)
                {
                tmp_last_searched = g_strdup(ws_gui_app->last_searched);
-               g_array_append_val(ws_gui_app->ws_gui_history_list, 
-                                  tmp_last_searched);
                }
                else
                {
                tmp_last_searched = g_strdup(ws_gui_app->last_searched_in_book);
-               g_array_append_val(ws_gui_app->ws_gui_history_bookmarks, 
-                                  tmp_last_searched);
                }
-               
+               g_array_append_val(ws_gui_app->ws_gui_history_list, 
+                                  tmp_last_searched);
+                               
                tmp_word = g_strdup(new_word);
+               
                g_array_append_val(ws_gui_app->ws_gui_history, tmp_word);
                g_array_append_val(ws_gui_app->ws_gui_history_iter, tmp_iter);
                
@@ -713,9 +712,9 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
                {
                        g_array_remove_index(ws_gui_app->ws_gui_history, 0);
                        g_array_remove_index(ws_gui_app->ws_gui_history_list, 
-                                            0);
+                                       0);
                        g_array_remove_index(ws_gui_app->ws_gui_history_iter, 
-                                            0);
+                                       0);
                        
                        ws_gui_app->ws_gui_history_cur_pos--;
                }
@@ -723,6 +722,7 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
                i = 0;
                tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i);
                }
+               
        }
         ws_gui_check_history(ws_gui_app);
 }