Mercurial > pidgin.yaz
comparison src/gtkroomlist.c @ 8377:c1ca19c8f749
[gaim-migrate @ 9104]
" This is xgrimx's patch to fix a crash if you click the
join button twice without changing the selection in the
room list dialog. He had me take a look at it and I did
and it fixes the problem." --marv
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 01 Mar 2004 18:01:11 +0000 |
parents | 77baefe979c6 |
children | 6d8ec773a485 |
comparison
equal
deleted
inserted
replaced
8376:7e9fdaab7163 | 8377:c1ca19c8f749 |
---|---|
154 GaimRoomlist *list; | 154 GaimRoomlist *list; |
155 GaimRoomlistRoom *room; | 155 GaimRoomlistRoom *room; |
156 }; | 156 }; |
157 | 157 |
158 static void | 158 static void |
159 join_button_data_change_cb(gpointer data) { | |
160 g_free(data); | |
161 } | |
162 | |
163 static void | |
159 selection_changed_cb(GtkTreeSelection *selection, GaimGtkRoomlist *grl) { | 164 selection_changed_cb(GtkTreeSelection *selection, GaimGtkRoomlist *grl) { |
160 GtkTreeIter iter; | 165 GtkTreeIter iter; |
161 GValue val = { 0, }; | 166 GValue val = { 0, }; |
162 GaimRoomlistRoom *room; | 167 GaimRoomlistRoom *room; |
163 static struct _menu_cb_info *info; | 168 static struct _menu_cb_info *info; |
175 | 180 |
176 info = g_new0(struct _menu_cb_info, 1); | 181 info = g_new0(struct _menu_cb_info, 1); |
177 info->list = dialog->roomlist; | 182 info->list = dialog->roomlist; |
178 info->room = room; | 183 info->room = room; |
179 | 184 |
180 g_object_set_data(G_OBJECT(dialog->join_button), "room-info", info); | 185 g_object_set_data_full(G_OBJECT(dialog->join_button), "room-info", |
186 info, join_button_data_change_cb); | |
181 | 187 |
182 gtk_widget_set_sensitive(dialog->join_button, TRUE); | 188 gtk_widget_set_sensitive(dialog->join_button, TRUE); |
183 } else { | 189 } else { |
184 gtk_widget_set_sensitive(dialog->join_button, FALSE); | 190 gtk_widget_set_sensitive(dialog->join_button, FALSE); |
185 } | 191 } |
196 GaimGtkRoomlist *grl = rl->ui_data; | 202 GaimGtkRoomlist *grl = rl->ui_data; |
197 struct _menu_cb_info *info; | 203 struct _menu_cb_info *info; |
198 | 204 |
199 info = (struct _menu_cb_info*)g_object_get_data(G_OBJECT(button), "room-info"); | 205 info = (struct _menu_cb_info*)g_object_get_data(G_OBJECT(button), "room-info"); |
200 | 206 |
201 do_join_cb(grl->tree, info); | 207 if(info != NULL) |
202 g_free(info); | 208 do_join_cb(grl->tree, info); |
203 } | 209 } |
204 | 210 |
205 static void row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2, | 211 static void row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2, |
206 GaimRoomlist *list) | 212 GaimRoomlist *list) |
207 { | 213 { |