[gnome-control-center/signal-connect-object: 14/16] common: Connect signals with g_signal_connect_object in swapped form
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/signal-connect-object: 14/16] common: Connect signals with g_signal_connect_object in swapped form
- Date: Fri, 22 Nov 2019 02:56:01 +0000 (UTC)
commit 254efe8bdda6fbfb950ed7e5e5ab761863eb32fb
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Nov 22 13:13:30 2019 +1300
common: Connect signals with g_signal_connect_object in swapped form
panels/common/cc-hostname-entry.c | 2 +-
panels/common/cc-language-chooser.c | 22 ++++++++++------------
2 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/panels/common/cc-hostname-entry.c b/panels/common/cc-hostname-entry.c
index dc2f3e7ef..aff139c31 100644
--- a/panels/common/cc-hostname-entry.c
+++ b/panels/common/cc-hostname-entry.c
@@ -233,7 +233,7 @@ cc_hostname_entry_constructed (GObject *object)
else
gtk_entry_set_text (GTK_ENTRY (self), "");
- g_signal_connect (G_OBJECT (self), "changed", G_CALLBACK (text_changed_cb), self);
+ g_signal_connect (self, "changed", G_CALLBACK (text_changed_cb), NULL);
}
static void
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index c1c11b601..0991cdc06 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -344,9 +344,8 @@ set_locale_id (CcLanguageChooser *chooser,
}
static void
-row_activated (GtkListBox *box,
- GtkListBoxRow *row,
- CcLanguageChooser *chooser)
+row_activated (CcLanguageChooser *chooser,
+ GtkListBoxRow *row)
{
gchar *new_locale_id;
@@ -368,13 +367,12 @@ row_activated (GtkListBox *box,
}
static void
-activate_default (GtkWindow *window,
- CcLanguageChooser *chooser)
+activate_default (CcLanguageChooser *chooser)
{
GtkWidget *focus;
gchar *locale_id;
- focus = gtk_window_get_focus (window);
+ focus = gtk_window_get_focus (GTK_WINDOW (chooser));
if (!focus)
return;
@@ -382,7 +380,7 @@ activate_default (GtkWindow *window,
if (g_strcmp0 (locale_id, chooser->language) == 0)
return;
- g_signal_stop_emission_by_name (window, "activate-default");
+ g_signal_stop_emission_by_name (GTK_WINDOW (chooser), "activate-default");
gtk_widget_activate (focus);
}
@@ -409,16 +407,16 @@ cc_language_chooser_init (CcLanguageChooser *chooser)
cc_list_box_update_header_func, NULL, NULL);
add_all_languages (chooser);
- g_signal_connect_swapped (chooser->language_filter_entry, "search-changed",
- G_CALLBACK (filter_changed), chooser);
+ g_signal_connect_object (chooser->language_filter_entry, "search-changed",
+ G_CALLBACK (filter_changed), chooser, G_CONNECT_SWAPPED);
- g_signal_connect (chooser->language_listbox, "row-activated",
- G_CALLBACK (row_activated), chooser);
+ g_signal_connect_object (chooser->language_listbox, "row-activated",
+ G_CALLBACK (row_activated), chooser, G_CONNECT_SWAPPED);
gtk_list_box_invalidate_filter (GTK_LIST_BOX (chooser->language_listbox));
g_signal_connect (chooser, "activate-default",
- G_CALLBACK (activate_default), chooser);
+ G_CALLBACK (activate_default), NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]