diff options
author | Milan Crha <mcrha@redhat.com> | 2010-10-19 22:38:39 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-10-19 22:38:39 +0800 |
commit | 689bb1148d8494b71036f9dcce8a9f79b53cbfe6 (patch) | |
tree | da799473d5eef675d6e650300358f861158be440 | |
parent | 686528cae95ea86f68d3d61bb38424943636e9ac (diff) | |
download | gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.tar gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.tar.gz gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.tar.bz2 gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.tar.lz gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.tar.xz gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.tar.zst gsoc2013-evolution-689bb1148d8494b71036f9dcce8a9f79b53cbfe6.zip |
Bug #630695 - Invalid read when enable/disable the account in preferences
-rw-r--r-- | widgets/misc/e-account-tree-view.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/widgets/misc/e-account-tree-view.c b/widgets/misc/e-account-tree-view.c index c99a4b55fa..923f395f0f 100644 --- a/widgets/misc/e-account-tree-view.c +++ b/widgets/misc/e-account-tree-view.c @@ -61,11 +61,12 @@ G_DEFINE_TYPE ( e_account_tree_view, GTK_TYPE_TREE_VIEW) -static void -account_tree_view_refresh_cb (EAccountList *account_list, - EAccount *account, - EAccountTreeView *tree_view) +static gboolean +account_tree_view_refresh_timeout_cb (gpointer ptree_view) { + EAccountTreeView *tree_view; + EAccountList *account_list; + EAccount *account; GtkListStore *store; GtkTreeModel *model; GtkTreeIter tree_iter; @@ -75,6 +76,9 @@ account_tree_view_refresh_cb (EAccountList *account_list, GList *list = NULL; GList *iter; + tree_view = ptree_view; + account_list = e_account_tree_view_get_account_list (tree_view); + store = gtk_list_store_new ( 5, E_TYPE_ACCOUNT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING); @@ -93,7 +97,6 @@ account_tree_view_refresh_cb (EAccountList *account_list, /* Build a list of EAccounts to display. */ account_iter = e_list_get_iterator (E_LIST (account_list)); while (e_iterator_is_valid (account_iter)) { - /* XXX EIterator misuses const. */ account = (EAccount *) e_iterator_get (account_iter); list = g_list_prepend (list, account); @@ -156,6 +159,16 @@ skip: g_object_unref (account); g_signal_emit (tree_view, signals[REFRESHED], 0); + + return FALSE; +} + +static void +account_tree_view_refresh_cb (EAccountList *account_list, + EAccount *account, + EAccountTreeView *tree_view) +{ + g_timeout_add (10, account_tree_view_refresh_timeout_cb, tree_view); } static void @@ -549,7 +562,7 @@ e_account_tree_view_set_account_list (EAccountTreeView *tree_view, tree_view); } - account_tree_view_refresh_cb (account_list, NULL, tree_view); + account_tree_view_refresh_timeout_cb (tree_view); g_object_notify (G_OBJECT (tree_view), "account-list"); } |