comparison src/gtkrequest.c @ 11458:4db38b374d3f

[gaim-migrate @ 13697] Fixing a couple assertion failures I caused a long time ago. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 06 Sep 2005 04:38:02 +0000
parents f0bc5f121684
children 8cb75ba77f9d
comparison
equal deleted inserted replaced
11457:4d9686e7c234 11458:4db38b374d3f
728 } 728 }
729 #endif /* !NEW_STYLE_COMPLETION */ 729 #endif /* !NEW_STYLE_COMPLETION */
730 730
731 #ifdef NEW_STYLE_COMPLETION 731 #ifdef NEW_STYLE_COMPLETION
732 static gboolean screenname_completion_match_func(GtkEntryCompletion *completion, 732 static gboolean screenname_completion_match_func(GtkEntryCompletion *completion,
733 const gchar *key, GtkTreeIter *iter, gpointer user_data) { 733 const gchar *key, GtkTreeIter *iter, gpointer user_data)
734 734 {
735 GtkTreeModel *model;
735 GValue val1 = { 0, }; 736 GValue val1 = { 0, };
736 GValue val2 = { 0, }; 737 GValue val2 = { 0, };
737 GtkTreeModel *model; 738 const char *tmp;
738 739
739 model = gtk_entry_completion_get_model (completion); 740 model = gtk_entry_completion_get_model (completion);
740 741
741 gtk_tree_model_get_value(model, iter, 2, &val1); 742 gtk_tree_model_get_value(model, iter, 2, &val1);
742 if (g_str_has_prefix(g_value_get_string(&val1), key)) 743 tmp = g_value_get_string(&val1);
744 if (tmp != NULL && g_str_has_prefix(tmp, key))
743 { 745 {
744 g_value_unset(&val1); 746 g_value_unset(&val1);
745 return TRUE; 747 return TRUE;
746 } 748 }
747 g_value_unset(&val1); 749 g_value_unset(&val1);
748 750
749 gtk_tree_model_get_value(model, iter, 3, &val2); 751 gtk_tree_model_get_value(model, iter, 3, &val2);
750 if (g_str_has_prefix(g_value_get_string(&val2), key)) 752 tmp = g_value_get_string(&val2);
753 if (tmp != NULL && g_str_has_prefix(tmp, key))
751 { 754 {
752 g_value_unset(&val2); 755 g_value_unset(&val2);
753 return TRUE; 756 return TRUE;
754 } 757 }
755 g_value_unset(&val2); 758 g_value_unset(&val2);
756 759
757 return FALSE; 760 return FALSE;
758 } 761 }
759 762
760 static gboolean screenname_completion_match_selected_cb(GtkEntryCompletion *completion, 763 static gboolean screenname_completion_match_selected_cb(GtkEntryCompletion *completion,
761 GtkTreeModel *model, GtkTreeIter *iter, gpointer *user_data) { 764 GtkTreeModel *model, GtkTreeIter *iter, gpointer *user_data)
762 765 {
763 GValue val = { 0, }; 766 GValue val = { 0, };
764 GaimRequestField *screen_field = user_data[1]; 767 GaimRequestField *screen_field = user_data[1];
765 GList *fields = screen_field->group->fields; 768 GList *fields = screen_field->group->fields;
766 GaimAccount *account; 769 GaimAccount *account;
767 770