comparison gtk/gtkstatusbox.c @ 14676:beabf64760e8

[gaim-migrate @ 17425] Oops, I leaked. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 04 Oct 2006 02:32:17 +0000
parents 587268c9c6d7
children 05c34aabdcc3
comparison
equal deleted inserted replaced
14675:44fb5200c7bb 14676:beabf64760e8
710 else 710 else
711 { 711 {
712 GtkTreeIter iter; 712 GtkTreeIter iter;
713 GtkGaimStatusBoxItemType type; 713 GtkGaimStatusBoxItemType type;
714 gpointer data; 714 gpointer data;
715 const char *name;
716 715
717 /* Unset the active item */ 716 /* Unset the active item */
718 gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), -1); 717 gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), -1);
719 718
720 /* If this saved status is in the list store, then set it as the active item */ 719 /* If this saved status is in the list store, then set it as the active item */
722 { 721 {
723 do 722 do
724 { 723 {
725 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, 724 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
726 TYPE_COLUMN, &type, 725 TYPE_COLUMN, &type,
727 TEXT_COLUMN, &name,
728 DATA_COLUMN, &data, 726 DATA_COLUMN, &data,
729 -1); 727 -1);
730 if (status_box->token_status_account && gaim_savedstatus_is_transient(saved_status) 728 if (status_box->token_status_account && gaim_savedstatus_is_transient(saved_status)
731 && type == GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE && primitive == GPOINTER_TO_INT(data)) 729 && type == GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE && primitive == GPOINTER_TO_INT(data))
732 { 730 {
731 char *name;
733 const char *acct_status_name = gaim_status_get_name( 732 const char *acct_status_name = gaim_status_get_name(
734 gaim_account_get_active_status(status_box->token_status_account)); 733 gaim_account_get_active_status(status_box->token_status_account));
734
735 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
736 TEXT_COLUMN, &name, -1);
737
735 if (!gaim_savedstatus_has_substatuses(saved_status) 738 if (!gaim_savedstatus_has_substatuses(saved_status)
736 || !strcmp(name, acct_status_name)) 739 || !strcmp(name, acct_status_name))
737 { 740 {
738 /* Found! */ 741 /* Found! */
739 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); 742 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter);
743 g_free(name);
740 break; 744 break;
741 } 745 }
746 g_free(name);
742 } 747 }
743 else if ((type == GTK_GAIM_STATUS_BOX_TYPE_POPULAR) && 748 else if ((type == GTK_GAIM_STATUS_BOX_TYPE_POPULAR) &&
744 (GPOINTER_TO_INT(data) == gaim_savedstatus_get_creation_time(saved_status))) 749 (GPOINTER_TO_INT(data) == gaim_savedstatus_get_creation_time(saved_status)))
745 { 750 {
746 /* Found! */ 751 /* Found! */