[gnome-todo] todoist-preferences-panel: fix signal connect for add_button
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] todoist-preferences-panel: fix signal connect for add_button
- Date: Mon, 19 Jun 2017 20:51:35 +0000 (UTC)
commit a761b22c2ff7fd4fbd5e419cce61783c23191db2
Author: Rohit Kaushik <kaushikrohit325 gmail com>
Date: Thu Jun 15 00:43:59 2017 +0530
todoist-preferences-panel: fix signal connect for add_button
Since, add_account_button_clicked only need the data,
that is GtdTodoistPreferencesPanel rather than instance
add_button, it should be g_signal_connect_swapped.
Currently with just g_signal_connect the callback
function will not work properly since data won't be
correctly passed.
https://bugzilla.gnome.org/show_bug.cgi?id=772278
plugins/todoist/gtd-todoist-preferences-panel.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/todoist/gtd-todoist-preferences-panel.c b/plugins/todoist/gtd-todoist-preferences-panel.c
index 03d4425..756da54 100644
--- a/plugins/todoist/gtd-todoist-preferences-panel.c
+++ b/plugins/todoist/gtd-todoist-preferences-panel.c
@@ -106,6 +106,8 @@ spawn_goa_with_args (const gchar *action,
static void
add_account_button_clicked (GtdTodoistPreferencesPanel *self)
{
+ g_return_if_fail (GOA_IS_CLIENT (self->client));
+
spawn_goa_with_args (NULL, NULL);
}
@@ -267,5 +269,5 @@ gtd_todoist_preferences_panel_init (GtdTodoistPreferencesPanel *self)
gtk_widget_show (label);
gtk_list_box_set_placeholder (GTK_LIST_BOX (self->accounts_listbox), GTK_WIDGET (label));
- g_signal_connect (self->add_button, "clicked", G_CALLBACK (add_account_button_clicked), self);
+ g_signal_connect_swapped (self->add_button, "clicked", G_CALLBACK (add_account_button_clicked), self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]