Commit ba897006 authored by Rohit Kaushik's avatar Rohit Kaushik Committed by Georges Basile Stavracas Neto
Browse files

todoist: fix some issues in preference panel

This patch fixes:

1) wrongly used key while getting goa-object associated
to accounts_listbox row.

2) load inital goa-accounts after goa-client is created.
That is call on_account_added on every account after
calling goa_client_get_accounts for first time.

3) free the accounts list returned from goa_client_get_
accounts which earlier was leaking.

https://bugzilla.gnome.org/show_bug.cgi?id=772278
parent 04535aa8
......@@ -180,7 +180,7 @@ on_goa_account_removed (GoaClient *client,
{
GoaObject *row_account;
row_account = GOA_OBJECT (g_object_get_data (G_OBJECT (l->data), "account"));
row_account = GOA_OBJECT (g_object_get_data (G_OBJECT (l->data), "goa-object"));
if (row_account == object)
{
......@@ -195,8 +195,19 @@ void
gtd_todoist_preferences_panel_set_client (GtdTodoistPreferencesPanel *self,
GoaClient *client)
{
GList *accounts;
GList *l;
accounts = NULL;
l = NULL;
self->client = client;
accounts = goa_client_get_accounts (self->client);
for (l = accounts; l != NULL; l = l->next)
on_goa_account_added (self->client, l->data, self);
g_signal_connect (self->client,
"account-added",
G_CALLBACK (on_goa_account_added),
......@@ -206,6 +217,8 @@ gtd_todoist_preferences_panel_set_client (GtdTodoistPreferencesPanel *self,
"account-removed",
G_CALLBACK (on_goa_account_removed),
self);
g_list_free_full (accounts, g_object_unref);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment