Merge lp:~gue5t/midori/proxy-prefs-sensitivity into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: André Stösel
Approved revision: 6328
Merged at revision: 6355
Proposed branch: lp:~gue5t/midori/proxy-prefs-sensitivity
Merge into: lp:midori
Diff against target: 35 lines (+6/-6)
1 file modified
midori/midori-preferences.c (+6/-6)
To merge this branch: bzr merge lp:~gue5t/midori/proxy-prefs-sensitivity
Reviewer Review Type Date Requested Status
André Stösel Approve
Review via email: mp+180638@code.launchpad.net

Commit message

Ensure proxy setting widgets callbacks don't outlive the widgets themselves

Description of the change

Old signal handlers were setting destroyed widgets as sensitive/insensitive if preferences was opened/closed multiple times. In some cases this meant the wrong widgets were being set; in others warnings or crashes would occur.

To post a comment you must log in.
Revision history for this message
André Stösel (ivaldi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-preferences.c'
2--- midori/midori-preferences.c 2013-08-04 14:27:34 +0000
3+++ midori/midori-preferences.c 2013-08-16 18:38:46 +0000
4@@ -523,16 +523,16 @@
5 INDENTED_ADD (label);
6 entry = katze_property_proxy (settings, "http-proxy", "address");
7 SPANNED_ADD (entry);
8- g_signal_connect (settings, "notify::proxy-type",
9- G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
10+ g_signal_connect_object (settings, "notify::proxy-type",
11+ G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry, 0);
12 midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
13 label = gtk_label_new (_("Port"));
14 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
15 INDENTED_ADD (label);
16 entry = katze_property_proxy (settings, "http-proxy-port", NULL);
17 SPANNED_ADD (entry);
18- g_signal_connect (settings, "notify::proxy-type",
19- G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
20+ g_signal_connect_object (settings, "notify::proxy-type",
21+ G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry, 0);
22 midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
23 INDENTED_ADD (gtk_event_box_new ());
24 label = gtk_label_new (NULL);
25@@ -550,8 +550,8 @@
26 gtk_label_set_markup (GTK_LABEL (label), proxy_types->str);
27 g_string_free (proxy_types, TRUE);
28 SPANNED_ADD (label);
29- g_signal_connect (settings, "notify::proxy-type",
30- G_CALLBACK (midori_preferences_notify_proxy_type_cb), label);
31+ g_signal_connect_object (settings, "notify::proxy-type",
32+ G_CALLBACK (midori_preferences_notify_proxy_type_cb), label, 0);
33 midori_preferences_notify_proxy_type_cb (settings, NULL, label);
34 #ifndef HAVE_WEBKIT2
35 if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE))

Subscribers

People subscribed via source and target branches

to all changes: