diff options
author | David Woodhouse <dwmw@amazon.co.uk> | 2017-10-06 22:30:02 +0100 |
---|---|---|
committer | David Woodhouse <dwmw@amazon.co.uk> | 2017-10-06 22:30:02 +0100 |
commit | 6b5e75dda5573d18af7b4df3edad8951536ca101 (patch) | |
tree | 7665555ec9f37372b695b80f993d4596cf5c885d | |
parent | 4e0d38dec2c9bd84cd88ff2039c93522af884974 (diff) | |
download | pidgin-6b5e75dda5573d18af7b4df3edad8951536ca101.tar.gz |
Fix Finch search results display (#17238)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | finch/gntnotify.c | 13 |
2 files changed, 12 insertions, 4 deletions
@@ -26,6 +26,9 @@ version 2.12.1 (??/??/????): * Better support for dark themes. (#12572 Alyssa Rosenzweig and Gary Kramlich) * Fixed IPv6 links by not escaping []'s. (#16391 cyisfor) (PR #270 Daniel Kamil Kozar) + Finch: + * Fix handling of search results (#17238 David Woodhouse) + version 2.12.0 (03/09/2017): libpurple: * Fix an out of bounds memory write in purple_markup_unescape_entity. diff --git a/finch/gntnotify.c b/finch/gntnotify.c index f32650d2b5..1ee752ee16 100644 --- a/finch/gntnotify.c +++ b/finch/gntnotify.c @@ -388,10 +388,11 @@ static void finch_notify_sr_new_rows(PurpleConnection *gc, PurpleNotifySearchResults *results, void *data) { - GntTree *tree = GNT_TREE(data); + GntWindow *window = GNT_WINDOW(data); + GntTree *tree = GNT_TREE(g_object_get_data(G_OBJECT(window), "tree-widget")); GList *o; - /* XXX: Do I need to empty the tree here? */ + gnt_tree_remove_all(GNT_TREE(tree)); for (o = results->rows; o; o = o->next) { @@ -483,12 +484,16 @@ finch_notify_searchresults(PurpleConnection *gc, const char *title, gnt_box_add_widget(GNT_BOX(window), box); - finch_notify_sr_new_rows(gc, results, tree); + g_object_set_data(G_OBJECT(window), "tree-widget", tree); + finch_notify_sr_new_rows(gc, results, window); + + g_signal_connect(G_OBJECT(window), "destroy", + G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(PURPLE_NOTIFY_SEARCHRESULTS)); gnt_widget_show(window); g_object_set_data(G_OBJECT(window), "notify-results", results); - return tree; + return window; } static void * |