Mercurial > pidgin
comparison src/buddy.c @ 4721:91ef4fae4a49
[gaim-migrate @ 5033]
plug a leak or two, and make removing buddies not blow up.
committer: Tailor Script <tailor@pidgin.im>
| author | Nathan Walp <nwalp@pidgin.im> |
|---|---|
| date | Wed, 12 Mar 2003 02:27:28 +0000 |
| parents | 8ecc83cad126 |
| children | 534eaa4ead94 |
comparison
equal
deleted
inserted
replaced
| 4720:06e8e5858121 | 4721:91ef4fae4a49 |
|---|---|
| 190 return FALSE; | 190 return FALSE; |
| 191 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); | 191 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
| 192 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); | 192 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
| 193 node = g_value_get_pointer(&val); | 193 node = g_value_get_pointer(&val); |
| 194 | 194 |
| 195 if (!GAIM_BLIST_NODE_IS_BUDDY(node)) | 195 if (!GAIM_BLIST_NODE_IS_BUDDY(node)) { |
| 196 gtk_tree_path_free(path); | |
| 196 return FALSE; | 197 return FALSE; |
| 198 } | |
| 197 | 199 |
| 198 menu = gtk_menu_new(); | 200 menu = gtk_menu_new(); |
| 199 | 201 |
| 200 /* Protocol specific options */ | 202 /* Protocol specific options */ |
| 201 prpl = find_prpl(((struct buddy*)node)->account->protocol); | 203 prpl = find_prpl(((struct buddy*)node)->account->protocol); |
| 235 | 237 |
| 236 #if (1) /* This code only exists because GTK doesn't work. If we return FALSE here, as would be normal | 238 #if (1) /* This code only exists because GTK doesn't work. If we return FALSE here, as would be normal |
| 237 * the event propoagates down and somehow gets interpreted as the start of a drag event. */ | 239 * the event propoagates down and somehow gets interpreted as the start of a drag event. */ |
| 238 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); | 240 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); |
| 239 gtk_tree_selection_select_path(sel, path); | 241 gtk_tree_selection_select_path(sel, path); |
| 242 gtk_tree_path_free(path); | |
| 240 return TRUE; | 243 return TRUE; |
| 241 #endif | 244 #endif |
| 242 } | 245 } |
| 243 | 246 |
| 244 static void gaim_gtk_blist_reordered_cb(GtkTreeModel *model, | 247 static void gaim_gtk_blist_reordered_cb(GtkTreeModel *model, |
| 310 gtk_selection_data_set (data, | 313 gtk_selection_data_set (data, |
| 311 gdk_atom_intern ("GAIM_BUDDY", FALSE), | 314 gdk_atom_intern ("GAIM_BUDDY", FALSE), |
| 312 8, /* bits */ | 315 8, /* bits */ |
| 313 (void*)&node, | 316 (void*)&node, |
| 314 sizeof (node)); | 317 sizeof (node)); |
| 315 } | 318 |
| 316 | 319 gtk_tree_path_free(sourcerow); |
| 320 } | |
| 321 | |
| 317 } | 322 } |
| 318 | 323 |
| 319 static void gaim_gtk_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, | 324 static void gaim_gtk_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
| 320 GtkSelectionData *sd, guint info, guint t) | 325 GtkSelectionData *sd, guint info, guint t) |
| 321 { | 326 { |
| 324 GtkTreePath *path = NULL; | 329 GtkTreePath *path = NULL; |
| 325 GtkTreeViewDropPosition position; | 330 GtkTreeViewDropPosition position; |
| 326 memcpy(&b, sd->data, sizeof(b)); | 331 memcpy(&b, sd->data, sizeof(b)); |
| 327 if(gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, &path, &position)) { | 332 if(gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, &path, &position)) { |
| 328 /* if we're here, I think it means the drop is ok */ | 333 /* if we're here, I think it means the drop is ok */ |
| 334 gtk_tree_path_free(path); | |
| 329 } | 335 } |
| 330 } | 336 } |
| 331 } | 337 } |
| 332 | 338 |
| 333 /*************************************************** | 339 /*************************************************** |
| 870 | 876 |
| 871 if (expand) { /* expand was set to true if this is the first element added to a group. In such case | 877 if (expand) { /* expand was set to true if this is the first element added to a group. In such case |
| 872 * we expand the group node */ | 878 * we expand the group node */ |
| 873 GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &groupiter); | 879 GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &groupiter); |
| 874 gtk_tree_view_expand_row(GTK_TREE_VIEW(gtkblist->treeview), path, TRUE); | 880 gtk_tree_view_expand_row(GTK_TREE_VIEW(gtkblist->treeview), path, TRUE); |
| 881 gtk_tree_path_free(path); | |
| 875 } | 882 } |
| 876 } | 883 } |
| 877 } | 884 } |
| 878 } | 885 } |
| 879 | 886 |
