comparison pidgin/gtknotify.c @ 23927:128f1d7e12ff

Some cleanup and a little leak fix that I thought I committed a while ago.
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 28 Aug 2008 00:55:35 +0000
parents 4a5c8feb83e6
children 9b61b1088dfb bbd148cd6866
comparison
equal deleted inserted replaced
23926:4a5c8feb83e6 23927:128f1d7e12ff
48 typedef struct 48 typedef struct
49 { 49 {
50 PurpleAccount *account; 50 PurpleAccount *account;
51 char *url; 51 char *url;
52 GtkWidget *label; 52 GtkWidget *label;
53 GtkTreeIter iter;
54 int count; 53 int count;
55 gboolean purple_has_handle; 54 gboolean purple_has_handle;
56 } PidginNotifyMailData; 55 } PidginNotifyMailData;
57 56
58 typedef struct 57 typedef struct
126 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter, 125 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter,
127 PIDGIN_MAIL_DATA, &data, -1); 126 PIDGIN_MAIL_DATA, &data, -1);
128 purple_notify_uri(NULL, data->url); 127 purple_notify_uri(NULL, data->url);
129 128
130 gtk_tree_store_remove(dialog->treemodel, &iter); 129 gtk_tree_store_remove(dialog->treemodel, &iter);
131 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); 130 if (data->purple_has_handle)
131 purple_notify_close(PURPLE_NOTIFY_EMAILS, data);
132 else
133 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data);
132 134
133 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) 135 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter))
134 return; 136 return;
135 } 137 }
136 else 138 else
485 gtk_tree_store_set(treemodel, &iter, 487 gtk_tree_store_set(treemodel, &iter,
486 PIDGIN_MAIL_ICON, icon, 488 PIDGIN_MAIL_ICON, icon,
487 PIDGIN_MAIL_TEXT, notification, 489 PIDGIN_MAIL_TEXT, notification,
488 PIDGIN_MAIL_DATA, data, 490 PIDGIN_MAIL_DATA, data,
489 -1); 491 -1);
490 data->iter = iter; /* XXX: Do we use this for something? */
491 data->account = account; 492 data->account = account;
492 data->count = count; 493 data->count = count;
493 494
494 /* Why is this necessary?*/
495 gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter,
496 PIDGIN_MAIL_DATA, &data, -1);
497 if (icon) 495 if (icon)
498 g_object_unref(icon); 496 g_object_unref(icon);
499 497
500 if (new_data) 498 if (new_data)
501 *new_data = new_n; 499 *new_data = new_n;