talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit ae895c83393ec495cdf3454de4ff12e89dcc65c8
parent c3b1f98e46c26df4d33de4b280960b301c0555a6
Author: Holger Berndt <hb@claws-mail.org>
Date:   Thu, 10 Jul 2014 21:15:58 +0200

Python plugin: Fix ComposeWindow.get_account_selection

Diffstat:
Msrc/plugins/python/composewindowtype.c | 18+++---------------
1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/src/plugins/python/composewindowtype.c b/src/plugins/python/composewindowtype.c @@ -344,23 +344,11 @@ static PyObject* ComposeWindow_add_header(clawsmail_ComposeWindowObject *self, P return Py_None; } -/* this is pretty ugly, as the compose struct does not maintain a pointer to the account selection combo */ static PyObject* ComposeWindow_get_account_selection(clawsmail_ComposeWindowObject *self, PyObject *args) { - GList *children, *walk; - - children = gtk_container_get_children(GTK_CONTAINER(self->compose->header_table)); - for(walk = children; walk; walk = walk->next) { - if(GTK_IS_HBOX(walk->data)) { - GList *children2, *walk2; - children2 = gtk_container_get_children(GTK_CONTAINER(walk->data)); - for(walk2 = children2; walk2; walk2 = walk2->next) { - if(GTK_IS_EVENT_BOX(walk2->data)) { - return get_gobj_from_address(gtk_container_get_children(GTK_CONTAINER(walk2->data))->data); - } - } - } - } + if(GTK_IS_COMBO_BOX(self->compose->account_combo)) + return get_gobj_from_address(self->compose->account_combo); + Py_INCREF(Py_None); return Py_None; }