comparison plugins/spellchk.c @ 11790:53490cc0fccf

[gaim-migrate @ 14081] Deleting multiple items from the list of corrections in the text replacement/spellchk plugin didn't work correctly. It would start at the top of the list, and delete items moving downward. Apparently this screwed up the GtkTreePaths or something, so it would delete the wrong iter. So now we start at the bottom and move up :-) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 24 Oct 2005 05:22:14 +0000
parents bee192436fa6
children e439530c0c6d
comparison
equal deleted inserted replaced
11789:1c53ff1e7a0d 11790:53490cc0fccf
1817 1817
1818 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path, 1818 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path,
1819 GtkTreeIter *iter, gpointer data) 1819 GtkTreeIter *iter, gpointer data)
1820 { 1820 {
1821 GSList **list = (GSList **)data; 1821 GSList **list = (GSList **)data;
1822 *list = g_slist_append(*list, gtk_tree_path_copy(path) ); 1822 *list = g_slist_prepend(*list, gtk_tree_path_copy(path));
1823 } 1823 }
1824 1824
1825 static void remove_row(void *data1, gpointer data2) 1825 static void remove_row(void *data1, gpointer data2)
1826 { 1826 {
1827 GtkTreePath *path = (GtkTreePath*)data1; 1827 GtkTreePath *path = (GtkTreePath*)data1;
1828 GtkTreeIter iter; 1828 GtkTreeIter iter;
1829 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path); 1829 if (gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
1830 gtk_list_store_remove(model, &iter); 1830 gtk_list_store_remove(model, &iter);
1831 gtk_tree_path_free(path); 1831 gtk_tree_path_free(path);
1832 } 1832 }
1833 1833
1834 static void list_delete() 1834 static void list_delete()
1835 { 1835 {